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

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

Merge pull request !7895 from 王旭鹏/master
...@@ -65,6 +65,7 @@ export default function appearJsunit() { ...@@ -65,6 +65,7 @@ export default function appearJsunit() {
console.info("testAppear01 on appearEvent err : " + JSON.stringify(err)); console.info("testAppear01 on appearEvent err : " + JSON.stringify(err));
} }
console.info("testAppear01 click result is: " + JSON.stringify(sendEventByKey('appear', 10, ""))); console.info("testAppear01 click result is: " + JSON.stringify(sendEventByKey('appear', 10, "")));
await Utils.sleep(1000);
console.info('[testAppear01] END'); console.info('[testAppear01] END');
console.info('[testAppear02] START'); console.info('[testAppear02] START');
......
...@@ -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();
}); });
......
...@@ -63,7 +63,7 @@ export default function alertDialogCenterStartJsunit() { ...@@ -63,7 +63,7 @@ export default function alertDialogCenterStartJsunit() {
var callback = (eventData) => { var callback = (eventData) => {
console.info("testalertDialogCenterStart0001 get event data is: " + JSON.stringify(eventData)); console.info("testalertDialogCenterStart0001 get event data is: " + JSON.stringify(eventData));
expect(eventData.data.Result).assertEqual(true); expect(eventData.data.Result).assertEqual(true);
console.info('testalertDialogCenterStart0011 END'); console.info('testalertDialogCenterStart0001 END');
done(); done();
} }
console.info("testalertDialogCenterStart0001 click result is: " + JSON.stringify(sendEventByKey('CenterStartButton', 10, ""))); console.info("testalertDialogCenterStart0001 click result is: " + JSON.stringify(sendEventByKey('CenterStartButton', 10, "")));
...@@ -85,7 +85,7 @@ export default function alertDialogCenterStartJsunit() { ...@@ -85,7 +85,7 @@ export default function alertDialogCenterStartJsunit() {
let measureOptions = {textContent : "alertDialog-CenterStart"}; let measureOptions = {textContent : "alertDialog-CenterStart"};
let width = measure.measureText(measureOptions); let width = measure.measureText(measureOptions);
console.info("++++++++++++++++++++++" + width.toString()); console.info("++++++++++++++++++++++" + width.toString());
expect(width > 0).assertFalse(); expect(width > 0).assertTrue();
done(); done();
} catch (err) { } catch (err) {
console.info("testMeasureText0001 err : " + JSON.stringify(err)); console.info("testMeasureText0001 err : " + JSON.stringify(err));
......
...@@ -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);
......
...@@ -75,7 +75,7 @@ export default function checkBoxGroupPartJsunit() { ...@@ -75,7 +75,7 @@ export default function checkBoxGroupPartJsunit() {
} }
var callback = (eventData) => { var callback = (eventData) => {
console.info("testcheckBoxGroup0001 get event state result is: " + JSON.stringify(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(); done();
} }
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,37 @@ import prompt from '@system.prompt' ...@@ -20,36 +20,37 @@ 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(); this.matrix3 = Matrix4.identity().scale(eventData.data.matrix3).copy();
console.info("this.matrix3 value is"); }
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 +130,7 @@ struct ohosMatrix4 { ...@@ -129,7 +130,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();
}); });
}) })
......
...@@ -156,7 +156,7 @@ struct DragExample { ...@@ -156,7 +156,7 @@ struct DragExample {
try { try {
var backData = { var backData = {
data: { data: {
"ACTION": 'onDragMove onAction' "ACTION": "onDragMove onAction"
} }
} }
var backEvent = { var backEvent = {
......
...@@ -86,8 +86,8 @@ export default function dragEventJsunit(){ ...@@ -86,8 +86,8 @@ export default function dragEventJsunit(){
await Utils.drag(downX, downY, upX, upY, 10) await Utils.drag(downX, downY, upX, upY, 10)
let callback = (indexEvent) => { let callback = (indexEvent) => {
console.info("dragEventTest_0200 get state result is: " + JSON.stringify(indexEvent)); console.info("dragEventTest_0200 get state result is: " + JSON.stringify(indexEvent));
expect(indexEvent.data.pointX).assertNotEqual(Null); expect(Number.isNaN(indexEvent.data.pointX)).assertFalse();
expect(indexEvent.data.pointY).assertNotEqual(Null); expect(Number.isNaN(indexEvent.data.pointY)).assertFalse();
} }
let indexEvent = { let indexEvent = {
eventId: 87, eventId: 87,
...@@ -115,7 +115,7 @@ export default function dragEventJsunit(){ ...@@ -115,7 +115,7 @@ export default function dragEventJsunit(){
await Utils.drag(downX, downY, upX, upY, 10) await Utils.drag(downX, downY, upX, upY, 10)
let callback = (indexEvent) => { let callback = (indexEvent) => {
console.info("dragEventTest_0300 get state result is: " + JSON.stringify(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 = { let indexEvent = {
eventId: 88, eventId: 88,
...@@ -143,7 +143,7 @@ export default function dragEventJsunit(){ ...@@ -143,7 +143,7 @@ export default function dragEventJsunit(){
await Utils.drag(downX, downY, upX, upY, 10) await Utils.drag(downX, downY, upX, upY, 10)
let callback = (indexEvent) => { let callback = (indexEvent) => {
console.info("dragEventTest_0400 get state result is: " + JSON.stringify(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 = { let indexEvent = {
eventId: 89, eventId: 89,
...@@ -171,7 +171,7 @@ export default function dragEventJsunit(){ ...@@ -171,7 +171,7 @@ export default function dragEventJsunit(){
await Utils.drag(downX, downY, upX, upY, 10) await Utils.drag(downX, downY, upX, upY, 10)
let callback = (indexEvent) => { let callback = (indexEvent) => {
console.info("dragEventTest_0500 get state result is: " + JSON.stringify(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 = { let indexEvent = {
eventId: 90, eventId: 90,
......
...@@ -66,12 +66,12 @@ export default function imageJsunit() { ...@@ -66,12 +66,12 @@ export default function imageJsunit() {
let obj = JSON.parse(strJson); let obj = JSON.parse(strJson);
console.info("imageTest_0200 obj.$attrs.src is: " + obj.$attrs.src); console.info("imageTest_0200 obj.$attrs.src is: " + obj.$attrs.src);
console.info("imageTest_0200 obj.obj.$type is: " + obj.$type); 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); console.info("imageTest_0200 result is: " + res);
var sres = obj.$attrs.src.slice(res, res + 16); var sres = obj.$attrs.src.slice(res, res + 16);
console.info("imageTest_0200 slice result is: " + sres); console.info("imageTest_0200 slice result is: " + sres);
expect(obj.$type).assertEqual('Image'); 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'); console.info('imageTest_0200 END');
done(); done();
}); });
......
...@@ -55,7 +55,7 @@ export default function playModeJsunit(){ ...@@ -55,7 +55,7 @@ export default function playModeJsunit(){
} }
let callback= (indexEvent) => { let callback= (indexEvent) => {
console.info("playModeTest_0100 get state result is: " + JSON.stringify(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 { try {
events_emitter.on(indexEvent, callback); events_emitter.on(indexEvent, callback);
......
...@@ -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));
......
...@@ -25,7 +25,7 @@ struct ClickExample { ...@@ -25,7 +25,7 @@ struct ClickExample {
Button('Click').backgroundColor(0x2788D9) Button('Click').backgroundColor(0x2788D9)
.key('button') .key('button')
.onClick((event: ClickEvent) => { .onClick((event: ClickEvent) => {
this.text = event.timestamp this.text = event.timestamp.toString()
console.info(this.text) console.info(this.text)
try { try {
var backData = { var backData = {
......
// @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");
...@@ -332,7 +332,7 @@ export default function buttonJsunit() { ...@@ -332,7 +332,7 @@ export default function buttonJsunit() {
try { try {
var eventData = { var eventData = {
data: { data: {
"buttonTypeValue": qaq, "buttonTypeValue": "qaq",
} }
} }
var innerEvent = { var innerEvent = {
...@@ -403,7 +403,7 @@ export default function buttonJsunit() { ...@@ -403,7 +403,7 @@ export default function buttonJsunit() {
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))
console.info("testButton15 indexEvent.data.fontColorValue is: " + indexEvent.data.fontColorValue) 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'); 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();
}); });
......
...@@ -64,12 +64,12 @@ export default function textJsunit() { ...@@ -64,12 +64,12 @@ export default function textJsunit() {
console.info("testText_0200 component strJson:" + strJson); console.info("testText_0200 component strJson:" + strJson);
let obj = JSON.parse(strJson); let obj = JSON.parse(strJson);
console.info("testText_0200 component obj is: " + JSON.stringify(obj)); 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); console.info("testText_0200 result is: " + res);
var sres = obj.$attrs.src.slice(res, res + 16); var sres = obj.$attrs.src.slice(res, res + 16);
console.info("testText_0200 slice result is: " + sres); console.info("testText_0200 slice result is: " + sres);
expect(obj.$type).assertEqual('Image'); 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'); console.info('testText_0200 END');
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,
......
...@@ -77,7 +77,7 @@ struct ImageAnimatorExample { ...@@ -77,7 +77,7 @@ struct ImageAnimatorExample {
try { try {
var backData = { var backData = {
data: { data: {
"string": 'Repeat' "string": "Repeat"
} }
} }
var backEvent = { var backEvent = {
......
...@@ -32,8 +32,7 @@ struct ScrollBarExample { ...@@ -32,8 +32,7 @@ struct ScrollBarExample {
this.directionValue = directionObject.directionValue; this.directionValue = directionObject.directionValue;
} }
if (eventData.data.stateValue != null) { if (eventData.data.stateValue != null) {
let stateObject = JSON.parse(eventData.data.stateObject); this.stateValue = eventData.data.stateValue;
this.stateValue = stateObject.stateValue;
} }
} }
} }
......
...@@ -49,10 +49,10 @@ export default function imageAnimatorJsunit(){ ...@@ -49,10 +49,10 @@ export default function imageAnimatorJsunit(){
it('imageAnimatorTest_0100', 0, async function (done) { it('imageAnimatorTest_0100', 0, async function (done) {
console.info('imageAnimatorTest_0100 START'); console.info('imageAnimatorTest_0100 START');
await Utils.sleep(500); await Utils.sleep(1500);
let callback = (indexEvent) => { let callback = (indexEvent) => {
console.info("imageAnimatorTest_0100 get state result is: " + JSON.stringify(indexEvent)); console.info("imageAnimatorTest_0100 get state result is: " + JSON.stringify(indexEvent.data.state));
expect(indexEvent.data.state).assertEqual(1); expect(indexEvent.data.state).assertEqual(AnimationStatus.Running);
done(); done();
} }
let indexEvent = { let indexEvent = {
...@@ -163,7 +163,7 @@ export default function imageAnimatorJsunit(){ ...@@ -163,7 +163,7 @@ export default function imageAnimatorJsunit(){
await Utils.sleep(1500); await Utils.sleep(1500);
let callback = (indexEvent) => { let callback = (indexEvent) => {
console.info("imageAnimatorTest_0600 get state result is: " + JSON.stringify(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 = { let indexEvent = {
eventId: 114, eventId: 114,
......
// @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");
...@@ -59,7 +59,7 @@ export default function scrollBarJsunit() { ...@@ -59,7 +59,7 @@ export default function scrollBarJsunit() {
it('testScrollBar002', 0, async function (done) { it('testScrollBar002', 0, async function (done) {
console.info('[testScrollBar002] START'); console.info('[testScrollBar002] START');
let object = { let object = {
"directionValue": ScrollBarDirection.Horizontal "directionValue": "ScrollBarDirection.Horizontal"
}; };
try { try {
var eventData = { var eventData = {
...@@ -101,7 +101,7 @@ export default function scrollBarJsunit() { ...@@ -101,7 +101,7 @@ export default function scrollBarJsunit() {
try { try {
let eventData = { let eventData = {
data: { data: {
"stateValue":"BarState.On" "stateValue": BarState.On
} }
} }
let indexEvent = { let indexEvent = {
...@@ -118,7 +118,7 @@ export default function scrollBarJsunit() { ...@@ -118,7 +118,7 @@ export default function scrollBarJsunit() {
console.info("[testScrollBar004] component strJson:" + strJson); console.info("[testScrollBar004] component strJson:" + strJson);
let obj = JSON.parse(strJson); let obj = JSON.parse(strJson);
console.info("[testScrollBar004] state:" + obj.$attrs.state); console.info("[testScrollBar004] state:" + obj.$attrs.state);
expect(obj.$attrs.state).assertEqual('BarState.Off'); expect(obj.$attrs.state).assertEqual("BarState.On");
done(); done();
}); });
...@@ -144,7 +144,7 @@ export default function scrollBarJsunit() { ...@@ -144,7 +144,7 @@ export default function scrollBarJsunit() {
console.info("[testScrollBar005] component strJson:" + strJson); console.info("[testScrollBar005] component strJson:" + strJson);
let obj = JSON.parse(strJson); let obj = JSON.parse(strJson);
console.info("[testScrollBar005] state:" + obj.$attrs.state); console.info("[testScrollBar005] state:" + obj.$attrs.state);
expect(obj.$attrs.state).assertEqual('BarState.Off'); expect(obj.$attrs.state).assertEqual("BarState.Auto");
done(); done();
}); });
}) })
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册