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

!7895 【ACE子系统】修改js crash问题

Merge pull request !7895 from 王旭鹏/master
......@@ -65,6 +65,7 @@ export default function appearJsunit() {
console.info("testAppear01 on appearEvent err : " + JSON.stringify(err));
}
console.info("testAppear01 click result is: " + JSON.stringify(sendEventByKey('appear', 10, "")));
await Utils.sleep(1000);
console.info('[testAppear01] END');
console.info('[testAppear02] START');
......
......@@ -126,7 +126,7 @@ export default function scrollOnScrollBeginJsunit() {
console.info("[testscrollOnScrollBegin0005] component align strJson:" + strJson);
let obj = JSON.parse(strJson);
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);
done();
});
......
......@@ -63,7 +63,7 @@ export default function alertDialogCenterStartJsunit() {
var callback = (eventData) => {
console.info("testalertDialogCenterStart0001 get event data is: " + JSON.stringify(eventData));
expect(eventData.data.Result).assertEqual(true);
console.info('testalertDialogCenterStart0011 END');
console.info('testalertDialogCenterStart0001 END');
done();
}
console.info("testalertDialogCenterStart0001 click result is: " + JSON.stringify(sendEventByKey('CenterStartButton', 10, "")));
......@@ -85,7 +85,7 @@ export default function alertDialogCenterStartJsunit() {
let measureOptions = {textContent : "alertDialog-CenterStart"};
let width = measure.measureText(measureOptions);
console.info("++++++++++++++++++++++" + width.toString());
expect(width > 0).assertFalse();
expect(width > 0).assertTrue();
done();
} catch (err) {
console.info("testMeasureText0001 err : " + JSON.stringify(err));
......
......@@ -56,7 +56,7 @@ export default function appVersionCodeJsunit() {
}
var callback = (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, "")));
events_emitter.on(innerEvent, callback);
......
......@@ -75,7 +75,7 @@ export default function checkBoxGroupPartJsunit() {
}
var callback = (eventData) => {
console.info("testcheckBoxGroup0001 get event state result is: " + JSON.stringify(eventData));
expect(eventData.data.STATUS).assertEqual(2);
expect(eventData.data.STATUS).assertEqual(0);
done();
}
events_emitter.on(innerEvent, callback);
......
......@@ -62,7 +62,7 @@ export default function unitsModuleNameJsunit() {
}
var callback = (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);
} catch (err) {
......
// @ts-nocheck
/**
* Copyright (c) 2021 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
......@@ -20,36 +20,37 @@ import prompt from '@system.prompt'
@Entry
@Component
struct ohosMatrix4 {
@State rotateValue: object= {
@State rotateValue: RotateOptions = {
x: 1,
y: 1,
z: 1,
centerX: '50%',
centerY: '50%',
centerX: 7,
centerY: 8,
angle: 300
}
@State translateValue: object= { x: 100, y: 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 transformValue1: object= Matrix4.identity().translate({ x: 100, y: 100, z: 30 })
@State matrix1: object= Matrix4.identity().transformPoint([100, 10])
@State matrix2: object = Matrix4.identity().translate({ x: 300 }).copy()
@State matrix3: object = Matrix4.identity().scale({ x: 3 }).copy()
@State matrix2: Matrix4.Matrix4Transit = Matrix4.identity().translate({ x: 300 }).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 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 matrix7: Matrix4.Matrix4Transit = Matrix4.identity().translate({ x: 300 }).combine(Matrix4.identity().scale({ x: 3 }));
@State onClickValue:boolean = false;
private stateChangCallBack = (eventData) => {
console.info("transFormExample page state change called:" + JSON.stringify(eventData));
if (eventData != null) {
console.info("eventData value is");
if (eventData.data.matrix2 != null && eventData.data.matrix3 != null) {
console.info("this.matrix2 value is" + Matrix4.identity()
.translate(eventData.data.matrix2)
.copy() + "2" + JSON.stringify(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();
let matrixV = Matrix4.identity().translate(eventData.data.matrix2);
if (matrixV != null) {
this.matrix2 = Matrix4.identity().translate(eventData.data.matrix2).copy();
this.matrix3 = Matrix4.identity().scale(eventData.data.matrix3).copy();
}
} else {
console.info("this.matrix value is not");
}
......@@ -129,7 +130,7 @@ struct ohosMatrix4 {
}).backgroundColor(0x2788D9).key('rotate5')
Image('/images/bg.jpg')
.padding(5)
.transform(this.matrix2.combine(this.matrix3))
.transform(this.matrix7)
.width("40%")
.height(100)
.margin({ top: 5 })
......
......@@ -169,9 +169,7 @@ export default function ohosMatrix4Jsunit() {
let objNew = JSON.parse(strJsonNew);
console.info("[test_OhosMatrix4_006] component objNew is: " + JSON.stringify(objNew));
console.info("[test_OhosMatrix4_006] component transform is: " + JSON.stringify(objNew.$attrs.transform));
expect(JSON.stringify(objNew.$attrs.transform)).assertEqual('{"type":"matrix",' +
'"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,"}');
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,"}');
done();
});
})
......
......@@ -156,7 +156,7 @@ struct DragExample {
try {
var backData = {
data: {
"ACTION": 'onDragMove onAction'
"ACTION": "onDragMove onAction"
}
}
var backEvent = {
......
......@@ -86,8 +86,8 @@ export default function dragEventJsunit(){
await Utils.drag(downX, downY, upX, upY, 10)
let callback = (indexEvent) => {
console.info("dragEventTest_0200 get state result is: " + JSON.stringify(indexEvent));
expect(indexEvent.data.pointX).assertNotEqual(Null);
expect(indexEvent.data.pointY).assertNotEqual(Null);
expect(Number.isNaN(indexEvent.data.pointX)).assertFalse();
expect(Number.isNaN(indexEvent.data.pointY)).assertFalse();
}
let indexEvent = {
eventId: 87,
......@@ -115,7 +115,7 @@ export default function dragEventJsunit(){
await Utils.drag(downX, downY, upX, upY, 10)
let callback = (indexEvent) => {
console.info("dragEventTest_0300 get state result is: " + JSON.stringify(indexEvent));
expect(indexEvent.data.ACTION).assertEqual('onDragMove onAction');
expect(indexEvent.data.ACTION).assertEqual("onDragMove onAction");
}
let indexEvent = {
eventId: 88,
......@@ -143,7 +143,7 @@ export default function dragEventJsunit(){
await Utils.drag(downX, downY, upX, upY, 10)
let callback = (indexEvent) => {
console.info("dragEventTest_0400 get state result is: " + JSON.stringify(indexEvent));
expect(indexEvent.data.ACTION).assertEqual('onDragLeave onAction');
expect(indexEvent.data.ACTION).assertEqual("onDragLeave onAction");
}
let indexEvent = {
eventId: 89,
......@@ -171,7 +171,7 @@ export default function dragEventJsunit(){
await Utils.drag(downX, downY, upX, upY, 10)
let callback = (indexEvent) => {
console.info("dragEventTest_0500 get state result is: " + JSON.stringify(indexEvent));
expect(indexEvent.data.ACTION).assertEqual('onDrop onAction');
expect(indexEvent.data.ACTION).assertEqual("onDrop onAction");
}
let indexEvent = {
eventId: 90,
......
......@@ -66,12 +66,12 @@ export default function imageJsunit() {
let obj = JSON.parse(strJson);
console.info("imageTest_0200 obj.$attrs.src is: " + obj.$attrs.src);
console.info("imageTest_0200 obj.obj.$type is: " + obj.$type);
var res = obj.$attrs.src.indexOf('rawfile/test.png');
var res = obj.$attrs.src.indexOf('RAWFILE/test.png');
console.info("imageTest_0200 result is: " + res);
var sres = obj.$attrs.src.slice(res, res + 16);
console.info("imageTest_0200 slice result is: " + sres);
expect(obj.$type).assertEqual('Image');
expect(obj.$attrs.src.slice(res, res + 16)).assertEqual('rawfile/test.png');
expect(obj.$attrs.src.slice(res, res + 16)).assertEqual('RAWFILE/test.png');
console.info('imageTest_0200 END');
done();
});
......
......@@ -55,7 +55,7 @@ export default function playModeJsunit(){
}
let callback= (indexEvent) => {
console.info("playModeTest_0100 get state result is: " + JSON.stringify(indexEvent))
except(indexEvent.data.playMode).assertEqual(PlayMode.AlternateReverse)
expect(indexEvent.data.playMode).assertEqual(PlayMode.AlternateReverse)
}
try {
events_emitter.on(indexEvent, callback);
......
......@@ -28,9 +28,9 @@ struct QrCode {
var colorValue = eventData.data.color;
if (colorValue != null && colorValue.length != 0) {
this.qrCodeColor = colorValue;
console.info("qrCodeColor:" + qrCodeColor);
console.info("qrCodeColor:" + this.qrCodeColor);
} else {
console.info("qrCodeColor is null or empty " + qrCodeColor);
console.info("qrCodeColor is null or empty " + this.qrCodeColor);
}
} else {
console.info("qrCode page color not change called:" + JSON.stringify(eventData));
......@@ -42,9 +42,9 @@ struct QrCode {
var backgroundColorValue = eventData.data.backgroundColor;
if (backgroundColorValue != null && backgroundColorValue.length != 0) {
this.qrCodeBackgroundColor = backgroundColorValue;
console.info("qrCodeBackgroundColor:" + qrCodeBackgroundColor);
console.info("qrCodeBackgroundColor:" + this.qrCodeBackgroundColor);
} else {
console.info("backgroundColorValue is null or empty " + qrCodeColor);
console.info("backgroundColorValue is null or empty " + this.qrCodeColor);
}
} else {
console.info("qrCode page backgroundColorValue not change called:" + JSON.stringify(eventData));
......
......@@ -25,7 +25,7 @@ struct ClickExample {
Button('Click').backgroundColor(0x2788D9)
.key('button')
.onClick((event: ClickEvent) => {
this.text = event.timestamp
this.text = event.timestamp.toString()
console.info(this.text)
try {
var backData = {
......
// @ts-nocheck
/**
* Copyright (c) 2021 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
......@@ -332,7 +332,7 @@ export default function buttonJsunit() {
try {
var eventData = {
data: {
"buttonTypeValue": qaq,
"buttonTypeValue": "qaq",
}
}
var innerEvent = {
......@@ -403,7 +403,7 @@ export default function buttonJsunit() {
let callback = (indexEvent) => {
console.info("testButton15 get state result is: " + JSON.stringify(indexEvent))
console.info("testButton15 indexEvent.data.fontColorValue is: " + indexEvent.data.fontColorValue)
expect(indexEvent.data.fontColorValue).assertEqual('ab996')
expect(indexEvent.data.fontColorValue).assertEqual("ab996")
console.info('[testButton15] END');
done();
}
......
......@@ -55,7 +55,7 @@ export default function scrollCodeJsunit() {
expect(obj.$attrs.scrollable).assertEqual('ScrollDirection.Vertical');
expect(obj.$attrs.scrollBar).assertEqual('BarState.On');
expect(obj.$attrs.scrollBarColor).assertEqual('#FF0000FF');
expect(obj.$attrs.scrollBarWidth).assertEqual('30.00px');
expect(obj.$attrs.scrollBarWidth).assertEqual('30.00vp');
done();
});
......@@ -159,7 +159,7 @@ export default function scrollCodeJsunit() {
let strJson = getInspectorByKey('ScrollCode');
let obj = JSON.parse(strJson);
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();
});
......
......@@ -64,12 +64,12 @@ export default function textJsunit() {
console.info("testText_0200 component strJson:" + strJson);
let obj = JSON.parse(strJson);
console.info("testText_0200 component obj is: " + JSON.stringify(obj));
var res = obj.$attrs.src.indexOf('rawfile/test.png');
var res = obj.$attrs.src.indexOf('RAWFILE/test.png');
console.info("testText_0200 result is: " + res);
var sres = obj.$attrs.src.slice(res, res + 16);
console.info("testText_0200 slice result is: " + sres);
expect(obj.$type).assertEqual('Image');
expect(obj.$attrs.src.slice(res, res + 16)).assertEqual('rawfile/test.png');
expect(obj.$attrs.src.slice(res, res + 16)).assertEqual('RAWFILE/test.png');
console.info('testText_0200 END');
done();
});
......
......@@ -50,7 +50,7 @@ export default function timeStampJsunit() {
await Utils.sleep(1500);
let callback = (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 = {
eventId: 230,
......
......@@ -77,7 +77,7 @@ struct ImageAnimatorExample {
try {
var backData = {
data: {
"string": 'Repeat'
"string": "Repeat"
}
}
var backEvent = {
......
......@@ -32,8 +32,7 @@ struct ScrollBarExample {
this.directionValue = directionObject.directionValue;
}
if (eventData.data.stateValue != null) {
let stateObject = JSON.parse(eventData.data.stateObject);
this.stateValue = stateObject.stateValue;
this.stateValue = eventData.data.stateValue;
}
}
}
......
......@@ -49,10 +49,10 @@ export default function imageAnimatorJsunit(){
it('imageAnimatorTest_0100', 0, async function (done) {
console.info('imageAnimatorTest_0100 START');
await Utils.sleep(500);
await Utils.sleep(1500);
let callback = (indexEvent) => {
console.info("imageAnimatorTest_0100 get state result is: " + JSON.stringify(indexEvent));
expect(indexEvent.data.state).assertEqual(1);
console.info("imageAnimatorTest_0100 get state result is: " + JSON.stringify(indexEvent.data.state));
expect(indexEvent.data.state).assertEqual(AnimationStatus.Running);
done();
}
let indexEvent = {
......@@ -163,7 +163,7 @@ export default function imageAnimatorJsunit(){
await Utils.sleep(1500);
let callback = (indexEvent) => {
console.info("imageAnimatorTest_0600 get state result is: " + JSON.stringify(indexEvent));
expect(indexEvent.data.string).assertEqual('repeat');
expect(indexEvent.data.string).assertEqual('Repeat');
}
let indexEvent = {
eventId: 114,
......
// @ts-nocheck
/**
* Copyright (c) 2021 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
......@@ -59,7 +59,7 @@ export default function scrollBarJsunit() {
it('testScrollBar002', 0, async function (done) {
console.info('[testScrollBar002] START');
let object = {
"directionValue": ScrollBarDirection.Horizontal
"directionValue": "ScrollBarDirection.Horizontal"
};
try {
var eventData = {
......@@ -101,7 +101,7 @@ export default function scrollBarJsunit() {
try {
let eventData = {
data: {
"stateValue":"BarState.On"
"stateValue": BarState.On
}
}
let indexEvent = {
......@@ -118,7 +118,7 @@ export default function scrollBarJsunit() {
console.info("[testScrollBar004] component strJson:" + strJson);
let obj = JSON.parse(strJson);
console.info("[testScrollBar004] state:" + obj.$attrs.state);
expect(obj.$attrs.state).assertEqual('BarState.Off');
expect(obj.$attrs.state).assertEqual("BarState.On");
done();
});
......@@ -144,7 +144,7 @@ export default function scrollBarJsunit() {
console.info("[testScrollBar005] component strJson:" + strJson);
let obj = JSON.parse(strJson);
console.info("[testScrollBar005] state:" + obj.$attrs.state);
expect(obj.$attrs.state).assertEqual('BarState.Off');
expect(obj.$attrs.state).assertEqual("BarState.Auto");
done();
});
})
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册