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

!8728 【ACE子系统】cherrypick OpenHarmony-4.0-Beta1

Merge pull request !8728 from hekun/cherry-pick-1684846688
// @ts-nocheck
/** /**
* Copyright (c) 2023 Huawei Device Co., Ltd. * Copyright (c) 2023 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,7 +19,7 @@ import events_emitter from '@ohos.events.emitter' ...@@ -20,7 +19,7 @@ import events_emitter from '@ohos.events.emitter'
@Entry @Entry
@Component @Component
struct EnabledExample { struct EnabledExample {
@State enabled: boolean = true; @State enabledd: boolean = true;
@State text: string = "enable"; @State text: string = "enable";
onPageShow() { onPageShow() {
...@@ -44,7 +43,7 @@ struct EnabledExample { ...@@ -44,7 +43,7 @@ struct EnabledExample {
if (eventData != null) { if (eventData != null) {
console.info("[stateChangCallBack] state change called: " + JSON.stringify(eventData)); console.info("[stateChangCallBack] state change called: " + JSON.stringify(eventData));
if (eventData.data.enabled != null) { if (eventData.data.enabled != null) {
this.enabled = eventData.data.enabled this.enabledd = eventData.data.enabled
} }
if (eventData.data.text != null) { if (eventData.data.text != null) {
this.text = eventData.data.text this.text = eventData.data.text
...@@ -61,7 +60,7 @@ struct EnabledExample { ...@@ -61,7 +60,7 @@ struct EnabledExample {
Button(this.text) Button(this.text)
.key('enabled') .key('enabled')
.backgroundColor(0x317aff) .backgroundColor(0x317aff)
.enabled(this.enabled) .enabled(this.enabledd)
} }
.width('100%') .width('100%')
.padding({ top: 5 }) .padding({ top: 5 })
......
// @ts-nocheck
/** /**
* Copyright (c) 2023 Huawei Device Co., Ltd. * Copyright (c) 2023 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
...@@ -60,7 +59,7 @@ struct SwiperExample { ...@@ -60,7 +59,7 @@ struct SwiperExample {
@State onActionCalledTwo: boolean = false; @State onActionCalledTwo: boolean = false;
@State onActionCalledThree: boolean = false; @State onActionCalledThree: boolean = false;
private aboutToAppear(): void { aboutToAppear(): void {
let list = [] let list = []
for (var i = 1; i <= 10; i++) { for (var i = 1; i <= 10; i++) {
list.push(i.toString()); list.push(i.toString());
......
...@@ -55,34 +55,6 @@ export default function enableJsunit() { ...@@ -55,34 +55,6 @@ export default function enableJsunit() {
console.info('[testEnable01] END'); console.info('[testEnable01] END');
done(); done();
}); });
it('testEnable02', 0, async function (done) {
console.info('[testEnable02] START');
try {
var eventData = {
data: {
"enabled": false,
"text": "disable"
}
}
var innerEvent = {
eventId: 93,
priority: events_emitter.EventPriority.LOW
}
console.info("[testEnable02] start to publish emit");
events_emitter.emit(innerEvent, eventData);
} catch (err) {
console.log("[testEnable02] change component data error: " + err.message);
}
await Utils.sleep(2000);
let strJson = getInspectorByKey('enabled');
let obj = JSON.parse(strJson);
console.info("[testEnable02] obj is: " + JSON.stringify(obj.$attrs.enabled));
expect(obj.$attrs.enabled).assertEqual(false);
console.info('testEnable02 END');
done();
});
it('testEnable03', 0, async function (done) { it('testEnable03', 0, async function (done) {
console.info('[testEnable03] START'); console.info('[testEnable03] START');
try { try {
...@@ -104,7 +76,7 @@ export default function enableJsunit() { ...@@ -104,7 +76,7 @@ export default function enableJsunit() {
let strJson = getInspectorByKey('enabled'); let strJson = getInspectorByKey('enabled');
let obj = JSON.parse(strJson); let obj = JSON.parse(strJson);
console.info("[testEnable03] obj is: " + JSON.stringify(obj)); console.info("[testEnable03] obj is: " + JSON.stringify(obj));
expect(obj.$attrs.enabled).assertEqual(false); expect(obj.$attrs.enabled).assertEqual(true);
console.info('testEnable03 END'); console.info('testEnable03 END');
done(); done();
}); });
...@@ -130,8 +102,36 @@ export default function enableJsunit() { ...@@ -130,8 +102,36 @@ export default function enableJsunit() {
let strJsonNew = getInspectorByKey('enabled'); let strJsonNew = getInspectorByKey('enabled');
let objNew = JSON.parse(strJsonNew); let objNew = JSON.parse(strJsonNew);
console.info("testEnable04 component objNew is: " + JSON.stringify(objNew)); console.info("testEnable04 component objNew is: " + JSON.stringify(objNew));
expect(objNew.$attrs.enabled).assertEqual(false); expect(objNew.$attrs.enabled).assertEqual(true);
done(); done();
}); });
it('testEnable02', 0, async function (done) {
console.info('[testEnable02] START');
try {
var eventData = {
data: {
"enabled": false,
"text": "disable"
}
}
var innerEvent = {
eventId: 93,
priority: events_emitter.EventPriority.LOW
}
console.info("[testEnable02] start to publish emit");
events_emitter.emit(innerEvent, eventData);
} catch (err) {
console.log("[testEnable02] change component data error: " + err.message);
}
await Utils.sleep(2000);
let strJson = getInspectorByKey('enabled');
let obj = JSON.parse(strJson);
console.info("[testEnable02] obj is: " + JSON.stringify(obj.$attrs.enabled));
expect(obj.$attrs.enabled).assertEqual(false);
console.info('testEnable02 END');
done();
});
}) })
} }
...@@ -65,14 +65,14 @@ export default function swiperJsunit() { ...@@ -65,14 +65,14 @@ export default function swiperJsunit() {
let obj = JSON.parse(strJson); let obj = JSON.parse(strJson);
console.info("swiperTest_0200 component obj is: " + JSON.stringify(obj)); console.info("swiperTest_0200 component obj is: " + JSON.stringify(obj));
let assertObjet = obj.$attrs.indicator; let assertObjet = obj.$attrs.indicator;
expect(assertObjet).assertTrue(); expect(assertObjet).assertEqual('true')
expect(obj.$attrs.loop).assertFalse(); expect(obj.$attrs.loop).assertEqual('false');
console.info('swiperTest_0200 END'); console.info('swiperTest_0200 END');
done(); done();
}); });
it('swiperTest_0300', 0, async function (done) { it('swiperTest_0300', 0, async function (done) {
console.info('swiperTest_0300 START'); console.info('swiperTest_0300 START');
let strJson = getInspectorByKey('swiper'); let strJson = getInspectorByKey('swiper');
console.info("swiperTest_0300 component strJson:" + strJson); console.info("swiperTest_0300 component strJson:" + strJson);
let obj = JSON.parse(strJson); let obj = JSON.parse(strJson);
...@@ -128,7 +128,7 @@ export default function swiperJsunit() { ...@@ -128,7 +128,7 @@ export default function swiperJsunit() {
let strJsonNew = getInspectorByKey('swiper'); let strJsonNew = getInspectorByKey('swiper');
let objNew = JSON.parse(strJsonNew); let objNew = JSON.parse(strJsonNew);
console.info("swiperTest_0600 component objNew is: " + JSON.stringify(objNew)); console.info("swiperTest_0600 component objNew is: " + JSON.stringify(objNew));
expect(objNew.$attrs.index).assertEqual('4'); expect(objNew.$attrs.index).assertEqual('3');
console.info('swiperTest_0600 END'); console.info('swiperTest_0600 END');
done(); done();
}); });
...@@ -338,8 +338,8 @@ export default function swiperJsunit() { ...@@ -338,8 +338,8 @@ export default function swiperJsunit() {
let strJsonNew = getInspectorByKey('swiper'); let strJsonNew = getInspectorByKey('swiper');
let objNew = JSON.parse(strJsonNew); let objNew = JSON.parse(strJsonNew);
console.info("swiperTest_1400 component objNew is: " + JSON.stringify(objNew)); console.info("swiperTest_1400 component objNew is: " + JSON.stringify(objNew));
let assertObjet = obj.$attrs.indicator; let assertObjet = objNew.$attrs.indicator;
expect(assertObjet).assertTrue(); expect(assertObjet).assertEqual('false');
console.info('swiperTest_1400 END'); console.info('swiperTest_1400 END');
done(); done();
}); });
......
...@@ -97,7 +97,7 @@ struct ListLanes { ...@@ -97,7 +97,7 @@ struct ListLanes {
.editMode(true) .editMode(true)
.alignListItem(ListItemAlign.Start) .alignListItem(ListItemAlign.Start)
.border({ width: 3, color: Color.Red }) .border({ width: 3, color: Color.Red })
.lanes({ minLength: 40, maxLength: 60 }) .lanes(4)
.onScrollFrameBegin((offset: number, state: ScrollState) => { .onScrollFrameBegin((offset: number, state: ScrollState) => {
if ((this.listPosition == 0 && offset >= 0) || (this.listPosition == 2 && offset <= 0)) { if ((this.listPosition == 0 && offset >= 0) || (this.listPosition == 2 && offset <= 0)) {
this.scroller.scrollBy(0, -offset) this.scroller.scrollBy(0, -offset)
......
...@@ -126,7 +126,7 @@ export default function listNewJsunit() { ...@@ -126,7 +126,7 @@ export default function listNewJsunit() {
console.info("[testListNe0006] component lanes strJson:" + strJson); console.info("[testListNe0006] component lanes strJson:" + strJson);
let obj = JSON.parse(strJson); let obj = JSON.parse(strJson);
expect(obj.$type).assertEqual('List'); expect(obj.$type).assertEqual('List');
expect(obj.$attrs.lanes).assertEqual('0'); expect(obj.$attrs.lanes).assertEqual('4');
console.info("[testListNe0006] lanes value :" + obj.$attrs.lanes); console.info("[testListNe0006] lanes value :" + obj.$attrs.lanes);
done(); done();
}); });
...@@ -143,7 +143,7 @@ export default function listNewJsunit() { ...@@ -143,7 +143,7 @@ export default function listNewJsunit() {
console.info("[testListNe0006] component lanes strJson:" + strJson); console.info("[testListNe0006] component lanes strJson:" + strJson);
let obj = JSON.parse(strJson); let obj = JSON.parse(strJson);
expect(obj.$type).assertEqual('List'); expect(obj.$type).assertEqual('List');
expect(obj.$attrs.lanes).assertEqual('0'); expect(obj.$attrs.lanes).assertEqual('4');
console.info("[testListNe0006] lanes value :" + obj.$attrs.lanes); console.info("[testListNe0006] lanes value :" + obj.$attrs.lanes);
done(); done();
}); });
......
...@@ -58,7 +58,7 @@ export default function list_itemOnSelectJsunit() { ...@@ -58,7 +58,7 @@ export default function list_itemOnSelectJsunit() {
console.info("[testlist_itemOnSelect0001] component border strJson:" + strJson); console.info("[testlist_itemOnSelect0001] component border strJson:" + strJson);
let obj = JSON.parse(strJson); let obj = JSON.parse(strJson);
expect(obj.$type).assertEqual('ListItem'); expect(obj.$type).assertEqual('ListItem');
expect(obj.$attrs.editable).assertEqual("true"); expect(obj.$attrs.editable).assertTrue();
console.info("[testlist_itemOnSelect0001] editable value :" + obj.$attrs.editable); console.info("[testlist_itemOnSelect0001] editable value :" + obj.$attrs.editable);
done(); done();
}); });
......
...@@ -56,7 +56,7 @@ export default function polyLineNeJsunit() { ...@@ -56,7 +56,7 @@ export default function polyLineNeJsunit() {
let strJson = getInspectorByKey('Polyline'); let strJson = getInspectorByKey('Polyline');
console.info("[testpolyLineNe0001] component width strJson:" + strJson); console.info("[testpolyLineNe0001] component width strJson:" + strJson);
let obj = JSON.parse(strJson); let obj = JSON.parse(strJson);
expect(obj.$type).assertEqual('Shape'); expect(obj.$type).assertEqual('Polyline');
expect(obj.$attrs.width).assertEqual("100.00px"); expect(obj.$attrs.width).assertEqual("100.00px");
console.info("[testpolyLineNe0001] width value :" + obj.$attrs.width); console.info("[testpolyLineNe0001] width value :" + obj.$attrs.width);
done(); done();
...@@ -73,7 +73,7 @@ export default function polyLineNeJsunit() { ...@@ -73,7 +73,7 @@ export default function polyLineNeJsunit() {
let strJson = getInspectorByKey('Polyline'); let strJson = getInspectorByKey('Polyline');
console.info("[testpolyLineNe0002] component height strJson:" + strJson); console.info("[testpolyLineNe0002] component height strJson:" + strJson);
let obj = JSON.parse(strJson); let obj = JSON.parse(strJson);
expect(obj.$type).assertEqual('Shape'); expect(obj.$type).assertEqual('Polyline');
expect(obj.$attrs.height).assertEqual("100.00px"); expect(obj.$attrs.height).assertEqual("100.00px");
console.info("[testpolyLineNe0002] height value :" + obj.$attrs.height); console.info("[testpolyLineNe0002] height value :" + obj.$attrs.height);
done(); done();
......
...@@ -143,9 +143,7 @@ export default function swiperCurveJsunit() { ...@@ -143,9 +143,7 @@ export default function swiperCurveJsunit() {
let obj = JSON.parse(strJson); let obj = JSON.parse(strJson);
expect(obj.$type).assertEqual('Swiper'); expect(obj.$type).assertEqual('Swiper');
let testObj = obj.$attrs.indicator; let testObj = obj.$attrs.indicator;
console.info("curve006_" + testObj); expect(testObj).assertEqual('true');
expect(testObj).assertTrue();
console.info("[testswiperCurve0006] indicator value :" + obj.$attrs.indicator);
done(); done();
}); });
......
...@@ -58,8 +58,7 @@ export default function swiperMaskJsunit() { ...@@ -58,8 +58,7 @@ export default function swiperMaskJsunit() {
let obj = JSON.parse(strJson); let obj = JSON.parse(strJson);
expect(obj.$type).assertEqual('Swiper'); expect(obj.$type).assertEqual('Swiper');
console.info("[testswiperMask001] indicatorStyle value :" + obj.$attrs.indicator); console.info("[testswiperMask001] indicatorStyle value :" + obj.$attrs.indicator);
let jsonObject = JSON.parse(obj.$attrs.indicator); expect(obj.$attrs.indicator).assertEqual('true');
expect(jsonObject.mask).assertEqual('true');
done(); done();
}); });
}) })
......
// @ts-nocheck
/** /**
* Copyright (c) 2023 Huawei Device Co., Ltd. * Copyright (c) 2023 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
...@@ -18,7 +17,7 @@ import events_emitter from '@ohos.events.emitter' ...@@ -18,7 +17,7 @@ import events_emitter from '@ohos.events.emitter'
@Entry @Entry
@Component @Component
struct SliderExample { struct SliderExample {
@State value:string=10 @State value:string= '10'
@State font:object={size: 30, weight:400, family: 'serif', style: FontStyle.Normal } @State font:object={size: 30, weight:400, family: 'serif', style: FontStyle.Normal }
@State fontColor: Color= 0xCCCCCC @State fontColor: Color= 0xCCCCCC
...@@ -60,7 +59,7 @@ struct SliderExample { ...@@ -60,7 +59,7 @@ struct SliderExample {
.selectedOptionFont({size: 40, weight: 500, family: 'serif', style: FontStyle.Normal }) .selectedOptionFont({size: 40, weight: 500, family: 'serif', style: FontStyle.Normal })
.optionFont({size: 30, weight: 400, family: 'serif', style: FontStyle.Normal }) .optionFont({size: 30, weight: 400, family: 'serif', style: FontStyle.Normal })
.key('select') .key('select')
.onSelected((index:number)=>{ .onSelect((index:number)=>{
console.info("Select:" + index) console.info("Select:" + index)
}) })
} }
......
...@@ -72,7 +72,7 @@ export default function dividerJsunit() { ...@@ -72,7 +72,7 @@ export default function dividerJsunit() {
console.log("cd divider strokeWidth" + JSON.stringify(obj.$attrs.strokeWidth)); console.log("cd divider strokeWidth" + JSON.stringify(obj.$attrs.strokeWidth));
console.log("cd divider vertical" + JSON.stringify(obj.$attrs.vertical)); console.log("cd divider vertical" + JSON.stringify(obj.$attrs.vertical));
console.log("cd divider lineCap" + JSON.stringify(obj.$attrs.lineCap)); console.log("cd divider lineCap" + JSON.stringify(obj.$attrs.lineCap));
expect(obj.$attrs.strokeWidth).assertEqual("7.000000") expect(obj.$attrs.strokeWidth).assertEqual("7.00vp")
expect(obj.$attrs.vertical).assertEqual('true') expect(obj.$attrs.vertical).assertEqual('true')
expect(obj.$attrs.lineCap == LineCapStyle.Square) expect(obj.$attrs.lineCap == LineCapStyle.Square)
console.info('cd dividerInspectorByKey END'); console.info('cd dividerInspectorByKey END');
......
...@@ -17,7 +17,6 @@ ...@@ -17,7 +17,6 @@
{ {
"type": "ShellKit", "type": "ShellKit",
"run-command": [ "run-command": [
"hilog -Q pidoff",
"power-shell wakeup", "power-shell wakeup",
"power-shell setmode 602" "power-shell setmode 602"
] ]
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册