diff --git a/arkui/ace_ets_component/entry/src/main/ets/test/TextStyleJsunit.test.ets b/arkui/ace_ets_component/entry/src/main/ets/test/TextStyleJsunit.test.ets index aca91372536fddfb6a50f539920c8f72f35e078b..12c909f2239d2c8655ed87b11aed9a14aa7a9810 100644 --- a/arkui/ace_ets_component/entry/src/main/ets/test/TextStyleJsunit.test.ets +++ b/arkui/ace_ets_component/entry/src/main/ets/test/TextStyleJsunit.test.ets @@ -45,120 +45,6 @@ export default function textStyleJsunit() { console.info("textStyle after each called"); }); - it('testTextStyle001', 0, async function (done) { - console.info('[testTextStyle001] START'); - await Utils.sleep(1000); - let strJson = getInspectorByKey('fontColor'); - console.info("[testTextStyle001] component strJson:" + strJson); - let obj = JSON.parse(strJson); - console.info("[testTextStyle001] fontColor: " + obj.$attrs.fontColor); - expect(obj.$attrs.fontColor).assertEqual('#FF000000'); - done(); - }); - - it('testTextStyle002', 0, async function (done) { - console.info('[testTextStyle002] START'); - try { - let eventData = { - data: { - "fontColor": Color.Blue - } - } - let indexEvent = { - eventId: 37, - priority: events_emitter.EventPriority.LOW - } - console.info("[testTextStyle002] start to publish emit"); - events_emitter.emit(indexEvent, eventData); - } catch (err) { - console.log("[testTextStyle002] change component data error: " + err.message); - } - await Utils.sleep(3000); - let strJson = getInspectorByKey('fontColor'); - console.info("[testTextStyle002] component strJson:" + strJson); - let obj = JSON.parse(strJson); - console.info("[testTextStyle002] fontColor: " + obj.$attrs.fontColor); - expect(obj.$attrs.fontColor).assertEqual('#FF000000'); - done(); - }); - - it('testTextStyle003', 0, async function (done) { - console.info('[testTextStyle003] START'); - try { - let eventData = { - data: { - "fontColor": 0x80000000 - } - } - let indexEvent = { - eventId: 37, - priority: events_emitter.EventPriority.LOW - } - console.info("[testTextStyle003] start to publish emit"); - events_emitter.emit(indexEvent, eventData); - } catch (err) { - console.log("[testTextStyle003] change component data error: " + err.message); - } - await Utils.sleep(3000); - let strJson = getInspectorByKey('fontColor'); - console.info("[testTextStyle003] component strJson:" + strJson); - let obj = JSON.parse(strJson); - console.info("[testTextStyle003] fontColor: " + obj.$attrs.fontColor); - expect(obj.$attrs.fontColor).assertEqual('#FF000000'); - done(); - }); - - it('testTextStyle004', 0, async function (done) { - console.info('[testTextStyle004] START'); - try { - let eventData = { - data: { - "fontColor": 0x7FFFFFFF - } - } - let indexEvent = { - eventId: 37, - priority: events_emitter.EventPriority.LOW - } - console.info("[testTextStyle004] start to publish emit"); - events_emitter.emit(indexEvent, eventData); - } catch (err) { - console.log("[testTextStyle004] change component data error: " + err.message); - } - await Utils.sleep(3000); - let strJson = getInspectorByKey('fontColor'); - console.info("[testTextStyle004] component strJson:" + strJson); - let obj = JSON.parse(strJson); - console.info("[testTextStyle004] fontColor: " + obj.$attrs.fontColor); - expect(obj.$attrs.fontColor).assertEqual('#FF000000'); - done(); - }); - - it('testTextStyle005', 0, async function (done) { - console.info('[testTextStyle005] START'); - try { - let eventData = { - data: { - "fontColor": 'error' - } - } - let indexEvent = { - eventId: 37, - priority: events_emitter.EventPriority.LOW - } - console.info("[testTextStyle005] start to publish emit"); - events_emitter.emit(indexEvent, eventData); - } catch (err) { - console.log("[testTextStyle005] change component data error: " + err.message); - } - await Utils.sleep(4000); - let strJson = getInspectorByKey('fontColor'); - console.info("[testTextStyle005] component strJson:" + strJson); - let obj = JSON.parse(strJson); - console.info("[testTextStyle005] fontColor: " + obj.$attrs.fontColor); - expect(obj.$attrs.fontColor).assertEqual('#FF000000'); - done(); - }); it('testTextStyle006', 0, async function (done) { console.info('[testTextStyle006] START'); diff --git a/arkui/ace_ets_component_three/entry/src/main/ets/MainAbility/pages/text.ets b/arkui/ace_ets_component_three/entry/src/main/ets/MainAbility/pages/text.ets index a32c76c4060b48ff01f194a04d8411b77e4003b9..714d818ef5d90d635c77256b02936841a36c373c 100644 --- a/arkui/ace_ets_component_three/entry/src/main/ets/MainAbility/pages/text.ets +++ b/arkui/ace_ets_component_three/entry/src/main/ets/MainAbility/pages/text.ets @@ -18,7 +18,7 @@ import events_emitter from '@ohos.events.emitter' @Component struct TextExample { @State fontSize: number = 9; - @State fontColor: string = "0xCCCCCC"; + @State fontColor: string = "#330A59F8"; @State textAlign: TextAlign = TextAlign.Start; @State textOverflow: TextOverflow = TextOverflow.Clip; @State decoration: TextDecorationType = TextDecorationType.None; diff --git a/arkui/ace_ets_component_three/entry/src/main/ets/test/SpanJsunit.test.ets b/arkui/ace_ets_component_three/entry/src/main/ets/test/SpanJsunit.test.ets index 6e1630baf8ca00054370c8b89deb3799c3cc2b5b..b67b9096e4dc80f4e31ef44bb6d7e6556f38661a 100644 --- a/arkui/ace_ets_component_three/entry/src/main/ets/test/SpanJsunit.test.ets +++ b/arkui/ace_ets_component_three/entry/src/main/ets/test/SpanJsunit.test.ets @@ -183,56 +183,5 @@ export default function spanJsunit() { done(); }); - it('testSpan008', 0, async function (done) { - console.info('[testSpan008] START'); - try { - let eventData = { - data: { - "fontColorValue": 'abc' - } - } - let indexEvent = { - eventId: 1031, - priority: events_emitter.EventPriority.LOW - } - console.info("[testSpan008] start to publish emit"); - events_emitter.emit(indexEvent, eventData); - } catch (err) { - console.log("[testSpan008] change component data error: " + err.message); - } - await Utils.sleep(4000); - let strJson = getInspectorByKey('fontColor'); - console.info("[testSpan008] component strJson:" + strJson); - let obj = JSON.parse(strJson); - console.info("[testSpan008] fontColor:" + obj); - expect(obj.$attrs.fontColor).assertEqual('#FF000990'); - done(); - }); - - it('testSpan009', 0, async function (done) { - console.info('[testSpan009] START'); - try { - let eventData = { - data: { - "fontColorValue": '-1' - } - } - let indexEvent = { - eventId: 1032, - priority: events_emitter.EventPriority.LOW - } - console.info("[testSpan009] start to publish emit"); - events_emitter.emit(indexEvent, eventData); - } catch (err) { - console.log("[testSpan009] change component data error: " + err.message); - } - await Utils.sleep(4000); - let strJson = getInspectorByKey('fontColor'); - console.info("[testSpan009] component strJson:" + strJson); - let obj = JSON.parse(strJson); - console.info("[testSpan009] fontColor:" + obj); - expect(obj.$attrs.fontColor).assertEqual('#FF000990'); - done(); - }); }) } \ No newline at end of file diff --git a/arkui/ace_ets_component_three/entry/src/main/ets/test/TextJsunit.test.ets b/arkui/ace_ets_component_three/entry/src/main/ets/test/TextJsunit.test.ets index 202d300cf508882aca872a3ea4ba697db04cd26a..799a7926354ca5681a2ac2428a2c2cd5b16c5758 100644 --- a/arkui/ace_ets_component_three/entry/src/main/ets/test/TextJsunit.test.ets +++ b/arkui/ace_ets_component_three/entry/src/main/ets/test/TextJsunit.test.ets @@ -101,7 +101,7 @@ export default function textJsunit() { let obj = JSON.parse(strJson); console.info("testText_0400 component obj is: " + JSON.stringify(obj)); expect(obj.$type).assertEqual('Text'); - expect(obj.$attrs.fontColor).assertEqual('#FF000000'); + expect(obj.$attrs.fontColor).assertEqual('#330A59F8'); console.info('testText_0400 END'); done(); }); @@ -217,38 +217,13 @@ export default function textJsunit() { done(); }); - it('testText_1100', 0, async function (done) { - console.info('testText_1100 START'); - try { - let eventData = { - data: { - "fontColor": "-a", - } - } - let indexEvent = { - eventId: 230, - priority: events_emitter.EventPriority.LOW - } - console.info("testText_1100 start to publish emit"); - events_emitter.emit(indexEvent, eventData); - } catch (err) { - console.log("testText_1100 change component data error: " + err.message); - } - await Utils.sleep(4000); - let strJsonNew = getInspectorByKey('text'); - let objNew = JSON.parse(strJsonNew); - console.info("testText_1100 component objNew is: " + JSON.stringify(objNew.$attrs.fontColor)); - expect(objNew.$attrs.fontColor).assertEqual('#330A59F7'); - console.info('testText_1100 END'); - done(); - }); - + it('testText_1200', 0, async function (done) { console.info('testText_1200 START'); try { let eventData = { data: { - "fontColor": "12321321", + "fontColor": "#FFBC0229", } } let indexEvent = { diff --git a/arkui/ace_ets_components_ux/ace_ets_component_progress/src/main/ets/TestAbility/pages/IndexSec.ets b/arkui/ace_ets_components_ux/ace_ets_component_progress/src/main/ets/TestAbility/pages/IndexSec.ets index 9028bffca4d81925cd8a2ad38392be3397d4d886..7f49f9553c81d070ccb6dc3bbca0ab58b1d23f19 100755 --- a/arkui/ace_ets_components_ux/ace_ets_component_progress/src/main/ets/TestAbility/pages/IndexSec.ets +++ b/arkui/ace_ets_components_ux/ace_ets_component_progress/src/main/ets/TestAbility/pages/IndexSec.ets @@ -18,6 +18,8 @@ import AbilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry import { Hypium } from '@ohos/hypium'; import hilog from '@ohos.hilog'; import testsuite from '../../test/List.test' +import {MessageManager,Callback} from '../../test/MessageManager.ets'; + @Entry @Component @@ -62,9 +64,12 @@ struct progressSecTest { private stateChangCallBack = (eventData) => { console.info("progress page state change called:" + JSON.stringify(eventData)); + console.info("[ArkUI_Stage_Progress_Capsule_BorderWidth_0400]: callback " + eventData.data.progress_capsule_borderWidth_resource); + this.progress_capsule_borderWidth_number = eventData.data.progress_capsule_borderWidth_number; this.progress_capsule_borderWidth_string = eventData.data.progress_capsule_borderWidth_string; this.progress_capsule_borderWidth_resource = eventData.data.progress_capsule_borderWidth_resource; + console.info("[ArkUI_Stage_Progress_Capsule_BorderWidth_0400]: callback2 " + this.progress_capsule_borderWidth_resource); this.progress_capsule_borderColor_number = eventData.data.progress_capsule_borderColor_number; this.progress_capsule_borderColor_string = eventData.data.progress_capsule_borderColor_string; this.progress_capsule_borderColor_color = eventData.data.progress_capsule_borderColor_color; @@ -100,6 +105,48 @@ struct progressSecTest { this.progress_linear_enableScanEffect_boolean = eventData.data.progress_linear_enableScanEffect_boolean; } + messageManager:MessageManager = new MessageManager() + onPageShow() { + console.info('divider onPageShow') + globalThis.value = { + name:'messageManager',message:this.messageManager + } + let callback:Callback = (message:any) => { + console.error('message = ' + message.name + "--" + message.value) + if (message.name == 'progress_capsule_borderWidth_resource') { + this.progress_capsule_borderWidth_resource = message.value + } + if (message.name == 'progress_capsule_borderColor_resource') { + this.progress_capsule_borderColor_resource = message.value + } + if (message.name == 'progress_capsule_fontSize_resource') { + this.progress_capsule_fontSize_resource = message.value + } + if (message.name == 'progress_capsule_fontColor_resource') { + this.progress_capsule_fontColor_resource = message.value + } + if (message.name == 'progress_ring_strokeWidth_resource') { + this.progress_ring_strokeWidth_resource = message.value + } + if (message.name == 'progress_ring_color_linear_number') { + this.progress_ring_color_linear_number = message.value + } + if (message.name == 'progress_ring_color_linear_string') { + this.progress_ring_color_linear_string = message.value + } + if (message.name == 'progress_ring_color_linear_color') { + this.progress_ring_color_linear_color = message.value + } + if (message.name == 'progress_ring_color_linear_resource') { + this.progress_ring_color_linear_resource = message.value + } + + + } + this.messageManager.registerCallback(callback) + + + } aboutToAppear(){ var stateChangeEvent = { @@ -110,350 +157,350 @@ struct progressSecTest { events_emitter.on(stateChangeEvent, this.stateChangCallBack); } - build() { - Column() { - Progress({ value: 60, total: 100, type: ProgressType.Capsule }) - .key('progress_capsule_default') - - Progress({ value: 60, total: 100, type: ProgressType.Capsule }) - .key('progress_capsule_default_default') - .backgroundColor($r('sys.color.ohos_id_color_background')) - .color($r('sys.color.ohos_id_color_emphasize_contrary')) - .style({ - borderWidth: $r('sys.float.ohos_id_float_progress_border_width'), - borderColor: $r('sys.color.ohos_id_color_emphasize_contrary'), - font: { - size: $r('sys.float.ohos_id_text_size_button3'), - }, - fontColor: $r('sys.color.ohos_id_color_text_primary'), - }) - .padding($r('sys.float.ohos_id_alpha_content_fourth')) - .margin($r('sys.float.ohos_id_alpha_highlight_bg')) - - Progress({ value: 60, total: 100, type: ProgressType.Capsule }) - .key('progress_capsule_showDefaultPercentage_default') - .style({ - showDefaultPercentage: true - }) - - Progress({ value: 60, total: 100, type: ProgressType.Capsule }) - .key('progress_capsule_number') - .style({ - borderWidth: this.progress_capsule_borderWidth_number, - borderColor: this.progress_capsule_borderColor_number, - font: { - size: this.progress_capsule_fontSize_number, - weight: this.progress_capsule_fontWeight_number, - style: this.progress_capsule_fontStyle_fontStyle - }, - fontColor: this.progress_capsule_fontColor_number, - content: this.progress_capsule_content_string, - enableScanEffect: this.progress_capsule_enableScanEffect_boolean, - showDefaultPercentage: this.progress_capsule_showDefaultPercentage_boolean - }) - - Progress({ value: 60, total: 100, type: ProgressType.Capsule }) - .key('progress_capsule_string') - .style({ - borderWidth: this.progress_capsule_borderWidth_string, - borderColor: this.progress_capsule_borderColor_string, - font: { - size: this.progress_capsule_fontSize_string, - weight: this.progress_capsule_fontWeight_string, - style: this.progress_capsule_fontStyle_fontStyle - }, - fontColor: this.progress_capsule_fontColor_string, - content: this.progress_capsule_content_string, - enableScanEffect: this.progress_capsule_enableScanEffect_boolean, - showDefaultPercentage: this.progress_capsule_showDefaultPercentage_boolean - }) - - Progress({ value: 60, total: 100, type: ProgressType.Capsule }) - .key('progress_capsule_enum') - .style({ - borderWidth: this.progress_capsule_borderWidth_number, - borderColor: this.progress_capsule_borderColor_color, - font: { - size: this.progress_capsule_fontSize_number, - weight: this.progress_capsule_fontWeight_fontWeight, - style: this.progress_capsule_fontStyle_fontStyle - }, - fontColor: this.progress_capsule_fontColor_color, - content: this.progress_capsule_content_string, - enableScanEffect: this.progress_capsule_enableScanEffect_boolean, - showDefaultPercentage: this.progress_capsule_showDefaultPercentage_boolean - }) - - Progress({ value: 60, total: 100, type: ProgressType.Capsule }) - .key('progress_capsule_resource') - .style({ - borderWidth: this.progress_capsule_borderWidth_resource, - borderColor: this.progress_capsule_borderColor_resource, - font: { - size: this.progress_capsule_fontSize_resource, - weight: this.progress_capsule_fontWeight_number, - style: this.progress_capsule_fontStyle_fontStyle - }, - fontColor: this.progress_capsule_fontColor_resource, - content: this.progress_capsule_content_string, - enableScanEffect: this.progress_capsule_enableScanEffect_boolean, - showDefaultPercentage: this.progress_capsule_showDefaultPercentage_boolean - }) - - Progress({ value: 60, total: 100, type: ProgressType.Capsule }) - .key('progress_capsule_resource_judge') - .style({ - borderWidth: $r('sys.float.ohos_id_text_margin_vertical'), - borderColor: $r('sys.color.ohos_id_color_connected'), - font: { - size: $r('sys.float.ohos_id_text_margin_vertical'), - weight: this.progress_capsule_fontWeight_number, - style: this.progress_capsule_fontStyle_fontStyle - }, - fontColor: $r('sys.color.ohos_id_color_connected'), - content: this.progress_capsule_content_string, - enableScanEffect: this.progress_capsule_enableScanEffect_boolean, - showDefaultPercentage: this.progress_capsule_showDefaultPercentage_boolean - }) - - - Progress({ value: 60, total: 100, type: ProgressType.Ring }) - .key('progress_ring_default') - - Progress({ value: 60, total: 100, type: ProgressType.Ring }) - .key('progress_ring_default_default') - .backgroundColor($r('sys.color.ohos_id_color_component_normal')) - - Progress({ value: 60, total: 100, type: ProgressType.Ring }) - .key('progress_ring_default_default_color_begin') - .color($r('sys.color.ohos_id_color_ring_progress_begin')) - - Progress({ value: 60, total: 100, type: ProgressType.Ring }) - .key('progress_ring_default_default_color_end') - .color($r('sys.color.ohos_id_color_ring_progress_end')) - - Progress({ value: 60, total: 100, type: ProgressType.Ring }) - .key('progress_ring_number') - .style({ - strokeWidth: this.progress_ring_strokeWidth_number, - shadow: this.progress_ring_shadow_bool, - status: this.progress_ring_status_progressStatus, - enableScanEffect: this.progress_ring_enableScanEffect_boolean - }) - .color(this.progress_ring_color_purity) - - Progress({ value: 60, total: 100, type: ProgressType.Ring }) - .key('progress_ring_string') - .style({ - strokeWidth: this.progress_ring_strokeWidth_string, - shadow: this.progress_ring_shadow_bool, - status: this.progress_ring_status_progressStatus, - enableScanEffect: this.progress_ring_enableScanEffect_boolean - }) - .color(this.progress_ring_color_purity) - - Progress({ value: 60, total: 100, type: ProgressType.Ring }) - .key('progress_ring_resource') - .style({ - strokeWidth: this.progress_ring_strokeWidth_resource, - shadow: this.progress_ring_shadow_bool, - status: this.progress_ring_status_progressStatus, - enableScanEffect: this.progress_ring_enableScanEffect_boolean - }) - .color(this.progress_ring_color_purity) - - Progress({ value: 60, total: 100, type: ProgressType.Ring }) - .key('progress_ring_resource_judge') - .style({ - strokeWidth: $r('sys.float.ohos_id_text_margin_vertical'), - shadow: this.progress_ring_shadow_bool, - status: this.progress_ring_status_progressStatus, - enableScanEffect: this.progress_ring_enableScanEffect_boolean - }) - .color($r('sys.color.ohos_id_color_background')) - .backgroundColor($r('sys.color.ohos_id_color_connected')) - - Progress({ value: 60, total: 100, type: ProgressType.Ring }) - .key('progress_ring_linear_number') - .style({ - strokeWidth: this.progress_ring_strokeWidth_number, - shadow: this.progress_ring_shadow_bool, - status: this.progress_ring_status_progressStatus - }) - .color(this.progress_ring_color_linear_number) - - Progress({ value: 60, total: 100, type: ProgressType.Ring }) - .key('progress_ring_linear_string') - .style({ - strokeWidth: this.progress_ring_strokeWidth_number, - shadow: this.progress_ring_shadow_bool, - status: this.progress_ring_status_progressStatus - }) - .color(this.progress_ring_color_linear_string) - - Progress({ value: 60, total: 100, type: ProgressType.Ring }) - .key('progress_ring_linear_color') - .style({ - strokeWidth: this.progress_ring_strokeWidth_number, - shadow: this.progress_ring_shadow_bool, - status: this.progress_ring_status_progressStatus - }) - .color(this.progress_ring_color_linear_color) - - Progress({ value: 60, total: 100, type: ProgressType.Ring }) - .key('progress_ring_linear_resource') - .style({ - strokeWidth: this.progress_ring_strokeWidth_number, - shadow: this.progress_ring_shadow_bool, - status: this.progress_ring_status_progressStatus - }) - .color(this.progress_ring_color_linear_resource) - - Progress({ value: 60, total: 100, type: ProgressType.Ring }) - .key('progress_ring_linear_null') - .style({ - strokeWidth: this.progress_ring_strokeWidth_number, - shadow: this.progress_ring_shadow_bool, - status: this.progress_ring_status_progressStatus - }) - .color(this.progress_ring_color_linear_null) - - Progress({ value: 60, total: 100, type: ProgressType.Ring }) - .key('progress_ring_linear_undefined') - .style({ - strokeWidth: this.progress_ring_strokeWidth_number, - shadow: this.progress_ring_shadow_bool, - status: this.progress_ring_status_progressStatus - }) - .color(this.progress_ring_color_linear_undefined) - - Progress({ value: 60, total: 100, type: ProgressType.Linear }) - .key('progress_linear_color_default') - - Progress({ value: 60, total: 100, type: ProgressType.Linear }) - .key('progress_linear_color_number') - .color(this.progress_ring_color_purity) - .style({ - enableScanEffect: this.progress_linear_enableScanEffect_boolean - }) - - Progress({ value: 60, total: 100, type: ProgressType.Linear }) - .key('progress_linear_color_linear_number') - .color(this.progress_ring_color_linear_number) - - Progress({ value: 60, total: 100, type: ProgressType.Linear }) - .key('progress_linear_color_linear_string') - .color(this.progress_ring_color_linear_string) - - Progress({ value: 60, total: 100, type: ProgressType.Linear }) - .key('progress_linear_color_linear_color') - .color(this.progress_ring_color_linear_color) - - Progress({ value: 60, total: 100, type: ProgressType.Linear }) - .key('progress_linear_color_linear_resource') - .color(this.progress_ring_color_linear_resource) - - Progress({ value: 60, total: 100, type: ProgressType.Linear }) - .key('progress_linear_color_linear_null') - .color(this.progress_ring_color_linear_null) - - Progress({ value: 60, total: 100, type: ProgressType.Linear }) - .key('progress_linear_color_linear_undefined') - .color(this.progress_ring_color_linear_undefined) - - Progress({ value: 60, total: 100, type: ProgressType.Eclipse }) - .key('progress_eclipse_color_default') - - Progress({ value: 60, total: 100, type: ProgressType.Eclipse }) - .key('progress_eclipse_color_number') - .color(this.progress_ring_color_purity) - - Progress({ value: 60, total: 100, type: ProgressType.Eclipse }) - .key('progress_eclipse_color_linear_number') - .color(this.progress_ring_color_linear_number) - - Progress({ value: 60, total: 100, type: ProgressType.Eclipse }) - .key('progress_eclipse_color_linear_string') - .color(this.progress_ring_color_linear_string) - - Progress({ value: 60, total: 100, type: ProgressType.Eclipse }) - .key('progress_eclipse_color_linear_color') - .color(this.progress_ring_color_linear_color) - - Progress({ value: 60, total: 100, type: ProgressType.Eclipse }) - .key('progress_eclipse_color_linear_resource') - .color(this.progress_ring_color_linear_resource) - - Progress({ value: 60, total: 100, type: ProgressType.Eclipse }) - .key('progress_eclipse_color_linear_null') - .color(this.progress_ring_color_linear_null) - - Progress({ value: 60, total: 100, type: ProgressType.Eclipse }) - .key('progress_eclipse_color_linear_undefined') - .color(this.progress_ring_color_linear_undefined) - - Progress({ value: 60, total: 100, type: ProgressType.ScaleRing }) - .key('progress_scaleRing_color_default') - - Progress({ value: 60, total: 100, type: ProgressType.ScaleRing }) - .key('progress_scaleRing_color_number') - .color(this.progress_ring_color_purity) - - Progress({ value: 60, total: 100, type: ProgressType.ScaleRing }) - .key('progress_scaleRing_color_linear_number') - .color(this.progress_ring_color_linear_number) - - Progress({ value: 60, total: 100, type: ProgressType.ScaleRing }) - .key('progress_scaleRing_color_linear_string') - .color(this.progress_ring_color_linear_string) - - Progress({ value: 60, total: 100, type: ProgressType.ScaleRing }) - .key('progress_scaleRing_color_linear_color') - .color(this.progress_ring_color_linear_color) - - Progress({ value: 60, total: 100, type: ProgressType.ScaleRing }) - .key('progress_scaleRing_color_linear_resource') - .color(this.progress_ring_color_linear_resource) - - Progress({ value: 60, total: 100, type: ProgressType.ScaleRing }) - .key('progress_scaleRing_color_linear_null') - .color(this.progress_ring_color_linear_null) - - Progress({ value: 60, total: 100, type: ProgressType.ScaleRing }) - .key('progress_scaleRing_color_linear_undefined') - .color(this.progress_ring_color_linear_undefined) + build() { + Column() { + Progress({ value: 60, total: 100, type: ProgressType.Capsule }) + .key('progress_capsule_default') + + Progress({ value: 60, total: 100, type: ProgressType.Capsule }) + .key('progress_capsule_default_default') + .backgroundColor($r('sys.color.ohos_id_color_background')) + .color($r('sys.color.ohos_id_color_emphasize_contrary')) + .style({ + borderWidth: $r('sys.float.ohos_id_float_progress_border_width'), + borderColor: $r('sys.color.ohos_id_color_emphasize_contrary'), + font: { + size: $r('sys.float.ohos_id_text_size_button3'), + }, + fontColor: $r('sys.color.ohos_id_color_text_primary'), + }) + .padding($r('sys.float.ohos_id_alpha_content_fourth')) + .margin($r('sys.float.ohos_id_alpha_highlight_bg')) + + Progress({ value: 60, total: 100, type: ProgressType.Capsule }) + .key('progress_capsule_showDefaultPercentage_default') + .style({ + showDefaultPercentage: true + }) + + Progress({ value: 60, total: 100, type: ProgressType.Capsule }) + .key('progress_capsule_number') + .style({ + borderWidth: this.progress_capsule_borderWidth_number, + borderColor: this.progress_capsule_borderColor_number, + font: { + size: this.progress_capsule_fontSize_number, + weight: this.progress_capsule_fontWeight_number, + style: this.progress_capsule_fontStyle_fontStyle + }, + fontColor: this.progress_capsule_fontColor_number, + content: this.progress_capsule_content_string, + enableScanEffect: this.progress_capsule_enableScanEffect_boolean, + showDefaultPercentage: this.progress_capsule_showDefaultPercentage_boolean + }) + + Progress({ value: 60, total: 100, type: ProgressType.Capsule }) + .key('progress_capsule_string') + .style({ + borderWidth: this.progress_capsule_borderWidth_string, + borderColor: this.progress_capsule_borderColor_string, + font: { + size: this.progress_capsule_fontSize_string, + weight: this.progress_capsule_fontWeight_string, + style: this.progress_capsule_fontStyle_fontStyle + }, + fontColor: this.progress_capsule_fontColor_string, + content: this.progress_capsule_content_string, + enableScanEffect: this.progress_capsule_enableScanEffect_boolean, + showDefaultPercentage: this.progress_capsule_showDefaultPercentage_boolean + }) + + Progress({ value: 60, total: 100, type: ProgressType.Capsule }) + .key('progress_capsule_enum') + .style({ + borderWidth: this.progress_capsule_borderWidth_number, + borderColor: this.progress_capsule_borderColor_color, + font: { + size: this.progress_capsule_fontSize_number, + weight: this.progress_capsule_fontWeight_fontWeight, + style: this.progress_capsule_fontStyle_fontStyle + }, + fontColor: this.progress_capsule_fontColor_color, + content: this.progress_capsule_content_string, + enableScanEffect: this.progress_capsule_enableScanEffect_boolean, + showDefaultPercentage: this.progress_capsule_showDefaultPercentage_boolean + }) + + Progress({ value: 60, total: 100, type: ProgressType.Capsule }) + .key('progress_capsule_resource') + .style({ + borderWidth: this.progress_capsule_borderWidth_resource, + borderColor: this.progress_capsule_borderColor_resource, + font: { + size: this.progress_capsule_fontSize_resource, + weight: this.progress_capsule_fontWeight_number, + style: this.progress_capsule_fontStyle_fontStyle + }, + fontColor: this.progress_capsule_fontColor_resource, + content: this.progress_capsule_content_string, + enableScanEffect: this.progress_capsule_enableScanEffect_boolean, + showDefaultPercentage: this.progress_capsule_showDefaultPercentage_boolean + }) + + Progress({ value: 60, total: 100, type: ProgressType.Capsule }) + .key('progress_capsule_resource_judge') + .style({ + borderWidth: $r('sys.float.ohos_id_text_margin_vertical'), + borderColor: $r('sys.color.ohos_id_color_connected'), + font: { + size: $r('sys.float.ohos_id_text_margin_vertical'), + weight: this.progress_capsule_fontWeight_number, + style: this.progress_capsule_fontStyle_fontStyle + }, + fontColor: $r('sys.color.ohos_id_color_connected'), + content: this.progress_capsule_content_string, + enableScanEffect: this.progress_capsule_enableScanEffect_boolean, + showDefaultPercentage: this.progress_capsule_showDefaultPercentage_boolean + }) + + + Progress({ value: 60, total: 100, type: ProgressType.Ring }) + .key('progress_ring_default') + + Progress({ value: 60, total: 100, type: ProgressType.Ring }) + .key('progress_ring_default_default') + .backgroundColor($r('sys.color.ohos_id_color_component_normal')) + + Progress({ value: 60, total: 100, type: ProgressType.Ring }) + .key('progress_ring_default_default_color_begin') + .color($r('sys.color.ohos_id_color_ring_progress_begin')) + + Progress({ value: 60, total: 100, type: ProgressType.Ring }) + .key('progress_ring_default_default_color_end') + .color($r('sys.color.ohos_id_color_ring_progress_end')) + + Progress({ value: 60, total: 100, type: ProgressType.Ring }) + .key('progress_ring_number') + .style({ + strokeWidth: this.progress_ring_strokeWidth_number, + shadow: this.progress_ring_shadow_bool, + status: this.progress_ring_status_progressStatus, + enableScanEffect: this.progress_ring_enableScanEffect_boolean + }) + .color(this.progress_ring_color_purity) + + Progress({ value: 60, total: 100, type: ProgressType.Ring }) + .key('progress_ring_string') + .style({ + strokeWidth: this.progress_ring_strokeWidth_string, + shadow: this.progress_ring_shadow_bool, + status: this.progress_ring_status_progressStatus, + enableScanEffect: this.progress_ring_enableScanEffect_boolean + }) + .color(this.progress_ring_color_purity) + + Progress({ value: 60, total: 100, type: ProgressType.Ring }) + .key('progress_ring_resource') + .style({ + strokeWidth: this.progress_ring_strokeWidth_resource, + shadow: this.progress_ring_shadow_bool, + status: this.progress_ring_status_progressStatus, + enableScanEffect: this.progress_ring_enableScanEffect_boolean + }) + .color(this.progress_ring_color_purity) + + Progress({ value: 60, total: 100, type: ProgressType.Ring }) + .key('progress_ring_resource_judge') + .style({ + strokeWidth: $r('sys.float.ohos_id_text_margin_vertical'), + shadow: this.progress_ring_shadow_bool, + status: this.progress_ring_status_progressStatus, + enableScanEffect: this.progress_ring_enableScanEffect_boolean + }) + .color($r('sys.color.ohos_id_color_background')) + .backgroundColor($r('sys.color.ohos_id_color_connected')) + + Progress({ value: 60, total: 100, type: ProgressType.Ring }) + .key('progress_ring_linear_number') + .style({ + strokeWidth: this.progress_ring_strokeWidth_number, + shadow: this.progress_ring_shadow_bool, + status: this.progress_ring_status_progressStatus + }) + .color(this.progress_ring_color_linear_number) + + Progress({ value: 60, total: 100, type: ProgressType.Ring }) + .key('progress_ring_linear_string') + .style({ + strokeWidth: this.progress_ring_strokeWidth_number, + shadow: this.progress_ring_shadow_bool, + status: this.progress_ring_status_progressStatus + }) + .color(this.progress_ring_color_linear_string) + + Progress({ value: 60, total: 100, type: ProgressType.Ring }) + .key('progress_ring_linear_color') + .style({ + strokeWidth: this.progress_ring_strokeWidth_number, + shadow: this.progress_ring_shadow_bool, + status: this.progress_ring_status_progressStatus + }) + .color(this.progress_ring_color_linear_color) + + Progress({ value: 60, total: 100, type: ProgressType.Ring }) + .key('progress_ring_linear_resource') + .style({ + strokeWidth: this.progress_ring_strokeWidth_number, + shadow: this.progress_ring_shadow_bool, + status: this.progress_ring_status_progressStatus + }) + .color(this.progress_ring_color_linear_resource) + + Progress({ value: 60, total: 100, type: ProgressType.Ring }) + .key('progress_ring_linear_null') + .style({ + strokeWidth: this.progress_ring_strokeWidth_number, + shadow: this.progress_ring_shadow_bool, + status: this.progress_ring_status_progressStatus + }) + .color(this.progress_ring_color_linear_null) + + Progress({ value: 60, total: 100, type: ProgressType.Ring }) + .key('progress_ring_linear_undefined') + .style({ + strokeWidth: this.progress_ring_strokeWidth_number, + shadow: this.progress_ring_shadow_bool, + status: this.progress_ring_status_progressStatus + }) + .color(this.progress_ring_color_linear_undefined) + + Progress({ value: 60, total: 100, type: ProgressType.Linear }) + .key('progress_linear_color_default') + + Progress({ value: 60, total: 100, type: ProgressType.Linear }) + .key('progress_linear_color_number') + .color(this.progress_ring_color_purity) + .style({ + enableScanEffect: this.progress_linear_enableScanEffect_boolean + }) + + Progress({ value: 60, total: 100, type: ProgressType.Linear }) + .key('progress_linear_color_linear_number') + .color(this.progress_ring_color_linear_number) + + Progress({ value: 60, total: 100, type: ProgressType.Linear }) + .key('progress_linear_color_linear_string') + .color(this.progress_ring_color_linear_string) + + Progress({ value: 60, total: 100, type: ProgressType.Linear }) + .key('progress_linear_color_linear_color') + .color(this.progress_ring_color_linear_color) + + Progress({ value: 60, total: 100, type: ProgressType.Linear }) + .key('progress_linear_color_linear_resource') + .color(this.progress_ring_color_linear_resource) + + Progress({ value: 60, total: 100, type: ProgressType.Linear }) + .key('progress_linear_color_linear_null') + .color(this.progress_ring_color_linear_null) + + Progress({ value: 60, total: 100, type: ProgressType.Linear }) + .key('progress_linear_color_linear_undefined') + .color(this.progress_ring_color_linear_undefined) + + Progress({ value: 60, total: 100, type: ProgressType.Eclipse }) + .key('progress_eclipse_color_default') + + Progress({ value: 60, total: 100, type: ProgressType.Eclipse }) + .key('progress_eclipse_color_number') + .color(this.progress_ring_color_purity) + + Progress({ value: 60, total: 100, type: ProgressType.Eclipse }) + .key('progress_eclipse_color_linear_number') + .color(this.progress_ring_color_linear_number) + + Progress({ value: 60, total: 100, type: ProgressType.Eclipse }) + .key('progress_eclipse_color_linear_string') + .color(this.progress_ring_color_linear_string) + + Progress({ value: 60, total: 100, type: ProgressType.Eclipse }) + .key('progress_eclipse_color_linear_color') + .color(this.progress_ring_color_linear_color) + + Progress({ value: 60, total: 100, type: ProgressType.Eclipse }) + .key('progress_eclipse_color_linear_resource') + .color(this.progress_ring_color_linear_resource) + + Progress({ value: 60, total: 100, type: ProgressType.Eclipse }) + .key('progress_eclipse_color_linear_null') + .color(this.progress_ring_color_linear_null) + + Progress({ value: 60, total: 100, type: ProgressType.Eclipse }) + .key('progress_eclipse_color_linear_undefined') + .color(this.progress_ring_color_linear_undefined) + + Progress({ value: 60, total: 100, type: ProgressType.ScaleRing }) + .key('progress_scaleRing_color_default') + + Progress({ value: 60, total: 100, type: ProgressType.ScaleRing }) + .key('progress_scaleRing_color_number') + .color(this.progress_ring_color_purity) + + Progress({ value: 60, total: 100, type: ProgressType.ScaleRing }) + .key('progress_scaleRing_color_linear_number') + .color(this.progress_ring_color_linear_number) + + Progress({ value: 60, total: 100, type: ProgressType.ScaleRing }) + .key('progress_scaleRing_color_linear_string') + .color(this.progress_ring_color_linear_string) + + Progress({ value: 60, total: 100, type: ProgressType.ScaleRing }) + .key('progress_scaleRing_color_linear_color') + .color(this.progress_ring_color_linear_color) + + Progress({ value: 60, total: 100, type: ProgressType.ScaleRing }) + .key('progress_scaleRing_color_linear_resource') + .color(this.progress_ring_color_linear_resource) + + Progress({ value: 60, total: 100, type: ProgressType.ScaleRing }) + .key('progress_scaleRing_color_linear_null') + .color(this.progress_ring_color_linear_null) + + Progress({ value: 60, total: 100, type: ProgressType.ScaleRing }) + .key('progress_scaleRing_color_linear_undefined') + .color(this.progress_ring_color_linear_undefined) - Progress({ value: 60, total: 100, type: ProgressType.Capsule }) - .key('progress_capsule_color_default') + Progress({ value: 60, total: 100, type: ProgressType.Capsule }) + .key('progress_capsule_color_default') - Progress({ value: 60, total: 100, type: ProgressType.Capsule }) - .key('progress_capsule_color_number') - .color(this.progress_ring_color_purity) + Progress({ value: 60, total: 100, type: ProgressType.Capsule }) + .key('progress_capsule_color_number') + .color(this.progress_ring_color_purity) - Progress({ value: 60, total: 100, type: ProgressType.Capsule }) - .key('progress_capsule_color_linear_number') - .color(this.progress_ring_color_linear_number) + Progress({ value: 60, total: 100, type: ProgressType.Capsule }) + .key('progress_capsule_color_linear_number') + .color(this.progress_ring_color_linear_number) - Progress({ value: 60, total: 100, type: ProgressType.Capsule }) - .key('progress_capsule_color_linear_string') - .color(this.progress_ring_color_linear_string) + Progress({ value: 60, total: 100, type: ProgressType.Capsule }) + .key('progress_capsule_color_linear_string') + .color(this.progress_ring_color_linear_string) - Progress({ value: 60, total: 100, type: ProgressType.Capsule }) - .key('progress_capsule_color_linear_color') - .color(this.progress_ring_color_linear_color) + Progress({ value: 60, total: 100, type: ProgressType.Capsule }) + .key('progress_capsule_color_linear_color') + .color(this.progress_ring_color_linear_color) - Progress({ value: 60, total: 100, type: ProgressType.Capsule }) - .key('progress_capsule_color_linear_resource') - .color(this.progress_ring_color_linear_resource) + Progress({ value: 60, total: 100, type: ProgressType.Capsule }) + .key('progress_capsule_color_linear_resource') + .color(this.progress_ring_color_linear_resource) - Progress({ value: 60, total: 100, type: ProgressType.Capsule }) - .key('progress_capsule_color_linear_null') - .color(this.progress_ring_color_linear_null) + Progress({ value: 60, total: 100, type: ProgressType.Capsule }) + .key('progress_capsule_color_linear_null') + .color(this.progress_ring_color_linear_null) - Progress({ value: 60, total: 100, type: ProgressType.Capsule }) - .key('progress_capsule_color_linear_undefined') - .color(this.progress_ring_color_linear_undefined) - } - .width('100%') + Progress({ value: 60, total: 100, type: ProgressType.Capsule }) + .key('progress_capsule_color_linear_undefined') + .color(this.progress_ring_color_linear_undefined) + } + .width('100%') } } \ No newline at end of file diff --git a/arkui/ace_ets_components_ux/ace_ets_component_progress/src/main/ets/test/MessageManager.ets b/arkui/ace_ets_components_ux/ace_ets_component_progress/src/main/ets/test/MessageManager.ets new file mode 100644 index 0000000000000000000000000000000000000000..70d716b6d61af8e8ba54a5a0affe80413221b168 --- /dev/null +++ b/arkui/ace_ets_components_ux/ace_ets_component_progress/src/main/ets/test/MessageManager.ets @@ -0,0 +1,54 @@ +/** + * Copyright (c) 2022 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +export interface Callback { + (message:any):void +} + +export class MessageManager { + callback:Callback + callbacks:Map = new Map() + + constructor() { + + } + + registerCallback(callback:Callback , type?:string) { + if (type == undefined) { + console.error('registerCallback callback set') + this.callback = callback + return + } + this.callbacks.set(type,callback) + } + + notify(message:any, type?:string) { + if (type == undefined) { + this.callback(message) + return + } + + let tmpCallback:Callback = this.callbacks.get(type) + if (tmpCallback === undefined) { + console.error('callbacks has no callback for type ' + type) + return + } + tmpCallback(message) + } + + clear() { + this.callbacks.clear() + this.callback = null + } +} \ No newline at end of file diff --git a/arkui/ace_ets_components_ux/ace_ets_component_progress/src/main/ets/test/progressSec.ets b/arkui/ace_ets_components_ux/ace_ets_component_progress/src/main/ets/test/progressSec.ets index c0cc9eda65e5b22e2b352ac07f7d51d88c577b86..1a841827830b607deac0f3a0b30e3640cfaa44dd 100755 --- a/arkui/ace_ets_components_ux/ace_ets_component_progress/src/main/ets/test/progressSec.ets +++ b/arkui/ace_ets_components_ux/ace_ets_component_progress/src/main/ets/test/progressSec.ets @@ -17,6 +17,7 @@ import { describe, beforeEach, afterEach, it, expect } from '@ohos/hypium' import events_emitter from '@ohos.events.emitter'; import Utils from './Utils.ets'; import router from '@system.router'; +import {MessageManager,Callback} from './MessageManager'; let emitKey = "emitUserAgent"; export default function progressSecTest() { @@ -66,7 +67,7 @@ export default function progressSecTest() { let progress_capsule_content_string: string = '下载' let progress_capsule_enableScanEffect_boolean: boolean = false let progress_capsule_showDefaultPercentage_boolean: boolean = false - + let progress_ring_strokeWidth_number: number = 4 let progress_ring_strokeWidth_string: string = '4vp' let progress_ring_strokeWidth_resource: Resource = $r('sys.float.ohos_id_text_margin_vertical') @@ -319,25 +320,10 @@ export default function progressSecTest() { console.info("[ArkUI_Stage_Progress_Capsule_BorderWidth_0400] start"); let newJson = getInspectorByKey('progress_capsule_resource'); console.info("[ArkUI_Stage_Progress_Capsule_BorderWidth_0400]: " + JSON.stringify(newJson)); - let progress_capsule_borderWidth_resource = $r('sys.float.ohos_id_text_margin_vertical'); - try { - var eventData = { - data: { - "progress_capsule_borderWidth_resource": progress_capsule_borderWidth_resource - } - } - var innerEvent = { - eventId: 183, - priority: events_emitter.EventPriority.LOW - } - console.info("[ArkUI_Stage_Progress_Capsule_BorderWidth_0400] start to publish emit"); - events_emitter.emit(innerEvent, eventData); - } catch (err) { - console.log("[ArkUI_Stage_Progress_Capsule_BorderWidth_0400] change component data error: " + err.message); - } - await Utils.sleep(2000); - + console.info("[ArkUI_Stage_Progress_Capsule_BorderWidth_0400 ..qianduan]: " + JSON.stringify(progress_capsule_borderWidth_resource)); + globalThis.value.message.notify({name:'progress_capsule_borderWidth_resource',value:progress_capsule_borderWidth_resource}); + Utils.sleep(2000); let strJson = getInspectorByKey('progress_capsule_resource'); let strJsonJudge = getInspectorByKey('progress_capsule_resource_judge'); console.info("[ArkUI_Stage_Progress_Capsule_BorderWidth_0400]: " + JSON.stringify(strJson)) @@ -862,21 +848,7 @@ export default function progressSecTest() { console.info("[ArkUI_Stage_Progress_Capsule_BorderColor_0500]: " + JSON.stringify(newJson)); let progress_capsule_borderColor_resource = $r('sys.color.ohos_id_color_connected'); - try { - var eventData = { - data: { - "progress_capsule_borderColor_resource": progress_capsule_borderColor_resource - } - } - var innerEvent = { - eventId: 183, - priority: events_emitter.EventPriority.LOW - } - console.info("[ArkUI_Stage_Progress_Capsule_BorderColor_0500] start to publish emit"); - events_emitter.emit(innerEvent, eventData); - } catch (err) { - console.log("[ArkUI_Stage_Progress_Capsule_BorderColor_0500] change component data error: " + err.message); - } + globalThis.value.message.notify({name:'progress_capsule_borderColor_resource',value:progress_capsule_borderColor_resource}); await Utils.sleep(2000); let strJson = getInspectorByKey('progress_capsule_resource'); @@ -1181,21 +1153,7 @@ export default function progressSecTest() { console.info("[ArkUI_Stage_Progress_Capsule_Font_Size_0400]: " + JSON.stringify(newJson)); let progress_capsule_fontSize_resource = $r('sys.float.ohos_id_text_margin_vertical'); - try { - var eventData = { - data: { - "progress_capsule_fontSize_resource": progress_capsule_fontSize_resource - } - } - var innerEvent = { - eventId: 183, - priority: events_emitter.EventPriority.LOW - } - console.info("[ArkUI_Stage_Progress_Capsule_Font_Size_0400] start to publish emit"); - events_emitter.emit(innerEvent, eventData); - } catch (err) { - console.log("[ArkUI_Stage_Progress_Capsule_Font_Size_0400] change component data error: " + err.message); - } + globalThis.value.message.notify({name:'progress_capsule_fontSize_resource',value:progress_capsule_fontSize_resource }); await Utils.sleep(2000); let strJson = getInspectorByKey('progress_capsule_resource'); @@ -2413,22 +2371,9 @@ export default function progressSecTest() { let newJson = getInspectorByKey('progress_capsule_resource'); console.info("[ArkUI_Stage_Progress_Capsule_FontColor_0500]: " + JSON.stringify(newJson)); + let progress_capsule_fontColor_resource = $r('sys.color.ohos_id_color_connected'); - try { - var eventData = { - data: { - "progress_capsule_fontColor_resource": progress_capsule_fontColor_resource - } - } - var innerEvent = { - eventId: 183, - priority: events_emitter.EventPriority.LOW - } - console.info("[ArkUI_Stage_Progress_Capsule_FontColor_0500] start to publish emit"); - events_emitter.emit(innerEvent, eventData); - } catch (err) { - console.log("[ArkUI_Stage_Progress_Capsule_FontColor_0500] change component data error: " + err.message); - } + globalThis.value.message.notify({name:'progress_capsule_fontColor_resource',value:progress_capsule_fontColor_resource}); await Utils.sleep(2000); let strJson = getInspectorByKey('progress_capsule_resource'); @@ -3321,22 +3266,9 @@ export default function progressSecTest() { let newJson = getInspectorByKey('progress_ring_resource'); console.info("[ArkUI_Stage_Progress_Ring_StrokeWidth_0400]: " + JSON.stringify(newJson)); + let progress_ring_strokeWidth_resource = $r('sys.float.ohos_id_text_margin_vertical'); - try { - var eventData = { - data: { - "progress_ring_strokeWidth_resource": progress_ring_strokeWidth_resource - } - } - var innerEvent = { - eventId: 183, - priority: events_emitter.EventPriority.LOW - } - console.info("[ArkUI_Stage_Progress_Ring_StrokeWidth_0400] start to publish emit"); - events_emitter.emit(innerEvent, eventData); - } catch (err) { - console.log("[ArkUI_Stage_Progress_Ring_StrokeWidth_0400] change component data error: " + err.message); - } + globalThis.value.message.notify({name:'progress_ring_strokeWidth_resource',value:progress_ring_strokeWidth_resource}); await Utils.sleep(2000); let strJson = getInspectorByKey('progress_ring_resource'); @@ -4104,21 +4036,7 @@ export default function progressSecTest() { console.info("[ArkUI_Stage_Progress_Ring_Color_0300]: " + JSON.stringify(newJson)); let progress_ring_color_linear_number = new LinearGradient([{color: 0xFFFF0000, offset: 0}, {color: 0xFFFFFFFF, offset: 1}]); - try { - var eventData = { - data: { - "progress_ring_color_linear_number": progress_ring_color_linear_number - } - } - var innerEvent = { - eventId: 183, - priority: events_emitter.EventPriority.LOW - } - console.info("[ArkUI_Stage_Progress_Ring_Color_0300] start to publish emit"); - events_emitter.emit(innerEvent, eventData); - } catch (err) { - console.log("[ArkUI_Stage_Progress_Ring_Color_0300] change component data error: " + err.message); - } + globalThis.value.message.notify({name:'progress_ring_color_linear_number',value:progress_ring_color_linear_number}); await Utils.sleep(2000); let strJson = getInspectorByKey('progress_ring_linear_number'); @@ -4141,23 +4059,10 @@ export default function progressSecTest() { console.info("[ArkUI_Stage_Progress_Ring_Color_0400]: " + JSON.stringify(newJson)); let progress_ring_color_linear_string = new LinearGradient([{color: '#FFFF9A35', offset: 0}, {color: '#FFFFFFFF', offset: 1}]); - try { - var eventData = { - data: { - "progress_ring_color_linear_string": progress_ring_color_linear_string - } - } - var innerEvent = { - eventId: 183, - priority: events_emitter.EventPriority.LOW - } - console.info("[ArkUI_Stage_Progress_Ring_Color_0400] start to publish emit"); - events_emitter.emit(innerEvent, eventData); - } catch (err) { - console.log("[ArkUI_Stage_Progress_Ring_Color_0400] change component data error: " + err.message); - } + globalThis.value.message.notify({name:'progress_ring_color_linear_string',value:progress_ring_color_linear_string}); await Utils.sleep(2000); + let strJson = getInspectorByKey('progress_ring_linear_string'); console.info("[ArkUI_Stage_Progress_Ring_Color_0400]: " + JSON.stringify(strJson)) let obj = JSON.parse(strJson); @@ -4178,21 +4083,7 @@ export default function progressSecTest() { console.info("[ArkUI_Stage_Progress_Ring_Color_0500]: " + JSON.stringify(newJson)); let progress_ring_color_linear_color = new LinearGradient([{color: Color.Red, offset: 0}, {color: Color.White, offset: 1}]); - try { - var eventData = { - data: { - "progress_ring_color_linear_color": progress_ring_color_linear_color - } - } - var innerEvent = { - eventId: 183, - priority: events_emitter.EventPriority.LOW - } - console.info("[ArkUI_Stage_Progress_Ring_Color_0500] start to publish emit"); - events_emitter.emit(innerEvent, eventData); - } catch (err) { - console.log("[ArkUI_Stage_Progress_Ring_Color_0500] change component data error: " + err.message); - } + globalThis.value.message.notify({name:'progress_ring_color_linear_color',value:progress_ring_color_linear_color}); await Utils.sleep(2000); let strJson = getInspectorByKey('progress_ring_linear_color'); @@ -4215,21 +4106,7 @@ export default function progressSecTest() { console.info("[ArkUI_Stage_Progress_Ring_Color_0600]: " + JSON.stringify(newJson)); let progress_ring_color_linear_resource = new LinearGradient([{color: $r('sys.color.ohos_id_color_connected'), offset: 0}, {color: $r('sys.color.ohos_id_color_background'), offset: 1}]); - try { - var eventData = { - data: { - "progress_ring_color_linear_resource": progress_ring_color_linear_resource - } - } - var innerEvent = { - eventId: 183, - priority: events_emitter.EventPriority.LOW - } - console.info("[ArkUI_Stage_Progress_Ring_Color_0600] start to publish emit"); - events_emitter.emit(innerEvent, eventData); - } catch (err) { - console.log("[ArkUI_Stage_Progress_Ring_Color_0600] change component data error: " + err.message); - } + globalThis.value.message.notify({name:'progress_ring_color_linear_resource',value:progress_ring_color_linear_resource}); await Utils.sleep(2000); let strJson = getInspectorByKey('progress_ring_linear_resource'); @@ -4403,23 +4280,11 @@ export default function progressSecTest() { console.info("[ArkUI_Stage_Progress_Ring_Color_1300] start"); let newJson = getInspectorByKey('progress_linear_color_linear_number'); console.info("[ArkUI_Stage_Progress_Ring_Color_1300]: " + JSON.stringify(newJson)); + + let progress_ring_color_linear_number = new LinearGradient([{color: 0xFFFF0000, offset: 0}, {color: 0xFFFFFFFF, offset: 1}]); - try { - var eventData = { - data: { - "progress_ring_color_linear_number": progress_ring_color_linear_number - } - } - var innerEvent = { - eventId: 183, - priority: events_emitter.EventPriority.LOW - } - console.info("[ArkUI_Stage_Progress_Ring_Color_1300] start to publish emit"); - events_emitter.emit(innerEvent, eventData); - } catch (err) { - console.log("[ArkUI_Stage_Progress_Ring_Color_1300] change component data error: " + err.message); - } + globalThis.value.message.notify({name:'progress_ring_color_linear_number',value:progress_ring_color_linear_number }) await Utils.sleep(2000); let strJson = getInspectorByKey('progress_linear_color_linear_number'); @@ -4442,21 +4307,7 @@ export default function progressSecTest() { console.info("[ArkUI_Stage_Progress_Ring_Color_1400]: " + JSON.stringify(newJson)); let progress_ring_color_linear_string = new LinearGradient([{color: '#FFFF9A35', offset: 0}, {color: '#FFFFFFFF', offset: 1}]); - try { - var eventData = { - data: { - "progress_ring_color_linear_string": progress_ring_color_linear_string - } - } - var innerEvent = { - eventId: 183, - priority: events_emitter.EventPriority.LOW - } - console.info("[ArkUI_Stage_Progress_Ring_Color_1400] start to publish emit"); - events_emitter.emit(innerEvent, eventData); - } catch (err) { - console.log("[ArkUI_Stage_Progress_Ring_Color_1400] change component data error: " + err.message); - } + globalThis.value.message.notify({name:'progress_ring_color_linear_string',value:progress_ring_color_linear_string}) await Utils.sleep(2000); let strJson = getInspectorByKey('progress_linear_color_linear_string'); @@ -4479,21 +4330,7 @@ export default function progressSecTest() { console.info("[ArkUI_Stage_Progress_Ring_Color_1500]: " + JSON.stringify(newJson)); let progress_ring_color_linear_color = new LinearGradient([{color: Color.Red, offset: 0}, {color: Color.White, offset: 1}]); - try { - var eventData = { - data: { - "progress_ring_color_linear_color": progress_ring_color_linear_color - } - } - var innerEvent = { - eventId: 183, - priority: events_emitter.EventPriority.LOW - } - console.info("[ArkUI_Stage_Progress_Ring_Color_1500] start to publish emit"); - events_emitter.emit(innerEvent, eventData); - } catch (err) { - console.log("[ArkUI_Stage_Progress_Ring_Color_1500] change component data error: " + err.message); - } + globalThis.value.message.notify({name:'progress_ring_color_linear_color',value:progress_ring_color_linear_color}) await Utils.sleep(2000); let strJson = getInspectorByKey('progress_linear_color_linear_color'); @@ -4516,23 +4353,10 @@ export default function progressSecTest() { console.info("[ArkUI_Stage_Progress_Ring_Color_1600]: " + JSON.stringify(newJson)); let progress_ring_color_linear_resource = new LinearGradient([{color: $r('sys.color.ohos_id_color_connected'), offset: 0}, {color: $r('sys.color.ohos_id_color_background'), offset: 1}]); - try { - var eventData = { - data: { - "progress_ring_color_linear_resource": progress_ring_color_linear_resource - } - } - var innerEvent = { - eventId: 183, - priority: events_emitter.EventPriority.LOW - } - console.info("[ArkUI_Stage_Progress_Ring_Color_1600] start to publish emit"); - events_emitter.emit(innerEvent, eventData); - } catch (err) { - console.log("[ArkUI_Stage_Progress_Ring_Color_1600] change component data error: " + err.message); - } + globalThis.value.message.notify({name:'progress_ring_color_linear_resource',value:progress_ring_color_linear_resource}) await Utils.sleep(2000); + let strJson = getInspectorByKey('progress_linear_color_linear_resource'); let strJsonJudge = getInspectorByKey('progress_ring_resource_judge'); console.info("[ArkUI_Stage_Progress_Ring_Color_1600]: " + JSON.stringify(strJson)) @@ -4708,21 +4532,8 @@ export default function progressSecTest() { console.info("[ArkUI_Stage_Progress_Ring_Color_2300]: " + JSON.stringify(newJson)); let progress_ring_color_linear_number = new LinearGradient([{color: 0xFFFF0000, offset: 0}, {color: 0xFFFFFFFF, offset: 1}]); - try { - var eventData = { - data: { - "progress_ring_color_linear_number": progress_ring_color_linear_number - } - } - var innerEvent = { - eventId: 183, - priority: events_emitter.EventPriority.LOW - } - console.info("[ArkUI_Stage_Progress_Ring_Color_2300] start to publish emit"); - events_emitter.emit(innerEvent, eventData); - } catch (err) { - console.log("[ArkUI_Stage_Progress_Ring_Color_2300] change component data error: " + err.message); - } + globalThis.value.message.notify({name:'progress_ring_color_linear_number',value:progress_ring_color_linear_number}); + await Utils.sleep(2000); let strJson = getInspectorByKey('progress_eclipse_color_linear_number'); @@ -4745,21 +4556,8 @@ export default function progressSecTest() { console.info("[ArkUI_Stage_Progress_Ring_Color_2400]: " + JSON.stringify(newJson)); let progress_ring_color_linear_string = new LinearGradient([{color: '#FFFF9A35', offset: 0}, {color: '#FFFFFFFF', offset: 1}]); - try { - var eventData = { - data: { - "progress_ring_color_linear_string": progress_ring_color_linear_string - } - } - var innerEvent = { - eventId: 183, - priority: events_emitter.EventPriority.LOW - } - console.info("[ArkUI_Stage_Progress_Ring_Color_2400] start to publish emit"); - events_emitter.emit(innerEvent, eventData); - } catch (err) { - console.log("[ArkUI_Stage_Progress_Ring_Color_2400] change component data error: " + err.message); - } + globalThis.value.message.notify({name:'progress_ring_color_linear_string',value:progress_ring_color_linear_string}); + await Utils.sleep(2000); let strJson = getInspectorByKey('progress_eclipse_color_linear_string'); @@ -4782,21 +4580,8 @@ export default function progressSecTest() { console.info("[ArkUI_Stage_Progress_Ring_Color_2500]: " + JSON.stringify(newJson)); let progress_ring_color_linear_color = new LinearGradient([{color: Color.Red, offset: 0}, {color: Color.White, offset: 1}]); - try { - var eventData = { - data: { - "progress_ring_color_linear_color": progress_ring_color_linear_color - } - } - var innerEvent = { - eventId: 183, - priority: events_emitter.EventPriority.LOW - } - console.info("[ArkUI_Stage_Progress_Ring_Color_2500] start to publish emit"); - events_emitter.emit(innerEvent, eventData); - } catch (err) { - console.log("[ArkUI_Stage_Progress_Ring_Color_2500] change component data error: " + err.message); - } + globalThis.value.message.notify({name:'progress_ring_color_linear_color',value:progress_ring_color_linear_color}); + await Utils.sleep(2000); let strJson = getInspectorByKey('progress_eclipse_color_linear_color'); @@ -4819,23 +4604,13 @@ export default function progressSecTest() { console.info("[ArkUI_Stage_Progress_Ring_Color_2600]: " + JSON.stringify(newJson)); let progress_ring_color_linear_resource = new LinearGradient([{color: $r('sys.color.ohos_id_color_connected'), offset: 0}, {color: $r('sys.color.ohos_id_color_background'), offset: 1}]); - try { - var eventData = { - data: { - "progress_ring_color_linear_resource": progress_ring_color_linear_resource - } - } - var innerEvent = { - eventId: 183, - priority: events_emitter.EventPriority.LOW - } - console.info("[ArkUI_Stage_Progress_Ring_Color_2600] start to publish emit"); - events_emitter.emit(innerEvent, eventData); - } catch (err) { - console.log("[ArkUI_Stage_Progress_Ring_Color_2600] change component data error: " + err.message); - } + + globalThis.value.message.notify({name:'progress_ring_color_linear_resource',value:progress_ring_color_linear_resource}); + await Utils.sleep(2000); + + let strJson = getInspectorByKey('progress_eclipse_color_linear_resource'); let strJsonJudge = getInspectorByKey('progress_ring_resource_judge'); console.info("[ArkUI_Stage_Progress_Ring_Color_2600]: " + JSON.stringify(strJson)) @@ -5011,21 +4786,9 @@ export default function progressSecTest() { console.info("[ArkUI_Stage_Progress_Ring_Color_3300]: " + JSON.stringify(newJson)); let progress_ring_color_linear_number = new LinearGradient([{color: 0xFFFF0000, offset: 0}, {color: 0xFFFFFFFF, offset: 1}]); - try { - var eventData = { - data: { - "progress_ring_color_linear_number": progress_ring_color_linear_number - } - } - var innerEvent = { - eventId: 183, - priority: events_emitter.EventPriority.LOW - } - console.info("[ArkUI_Stage_Progress_Ring_Color_3300] start to publish emit"); - events_emitter.emit(innerEvent, eventData); - } catch (err) { - console.log("[ArkUI_Stage_Progress_Ring_Color_3300] change component data error: " + err.message); - } + + globalThis.value.message.notify({name:'progress_ring_color_linear_number',value:progress_ring_color_linear_number}); + await Utils.sleep(2000); let strJson = getInspectorByKey('progress_scaleRing_color_linear_number'); @@ -5048,21 +4811,9 @@ export default function progressSecTest() { console.info("[ArkUI_Stage_Progress_Ring_Color_3400]: " + JSON.stringify(newJson)); let progress_ring_color_linear_string = new LinearGradient([{color: '#FFFF9A35', offset: 0}, {color: '#FFFFFFFF', offset: 1}]); - try { - var eventData = { - data: { - "progress_ring_color_linear_string": progress_ring_color_linear_string - } - } - var innerEvent = { - eventId: 183, - priority: events_emitter.EventPriority.LOW - } - console.info("[ArkUI_Stage_Progress_Ring_Color_3400] start to publish emit"); - events_emitter.emit(innerEvent, eventData); - } catch (err) { - console.log("[ArkUI_Stage_Progress_Ring_Color_3400] change component data error: " + err.message); - } + + globalThis.value.message.notify({name:'progress_ring_color_linear_string',value:progress_ring_color_linear_string}); + await Utils.sleep(2000); let strJson = getInspectorByKey('progress_scaleRing_color_linear_string'); @@ -5085,21 +4836,8 @@ export default function progressSecTest() { console.info("[ArkUI_Stage_Progress_Ring_Color_3500]: " + JSON.stringify(newJson)); let progress_ring_color_linear_color = new LinearGradient([{color: Color.Red, offset: 0}, {color: Color.White, offset: 1}]); - try { - var eventData = { - data: { - "progress_ring_color_linear_color": progress_ring_color_linear_color - } - } - var innerEvent = { - eventId: 183, - priority: events_emitter.EventPriority.LOW - } - console.info("[ArkUI_Stage_Progress_Ring_Color_3500] start to publish emit"); - events_emitter.emit(innerEvent, eventData); - } catch (err) { - console.log("[ArkUI_Stage_Progress_Ring_Color_3500] change component data error: " + err.message); - } + globalThis.value.message.notify({name:'progress_ring_color_linear_color',value:progress_ring_color_linear_color}); + await Utils.sleep(2000); let strJson = getInspectorByKey('progress_scaleRing_color_linear_color'); @@ -5122,21 +4860,10 @@ export default function progressSecTest() { console.info("[ArkUI_Stage_Progress_Ring_Color_3600]: " + JSON.stringify(newJson)); let progress_ring_color_linear_resource = new LinearGradient([{color: $r('sys.color.ohos_id_color_connected'), offset: 0}, {color: $r('sys.color.ohos_id_color_background'), offset: 1}]); - try { - var eventData = { - data: { - "progress_ring_color_linear_resource": progress_ring_color_linear_resource - } - } - var innerEvent = { - eventId: 183, - priority: events_emitter.EventPriority.LOW - } - console.info("[ArkUI_Stage_Progress_Ring_Color_3600] start to publish emit"); - events_emitter.emit(innerEvent, eventData); - } catch (err) { - console.log("[ArkUI_Stage_Progress_Ring_Color_3600] change component data error: " + err.message); - } + + globalThis.value.message.notify({name:'progress_ring_color_linear_resource',value:progress_ring_color_linear_resource}); + + await Utils.sleep(2000); let strJson = getInspectorByKey('progress_scaleRing_color_linear_resource'); @@ -5314,21 +5041,8 @@ export default function progressSecTest() { console.info("[ArkUI_Stage_Progress_Ring_Color_4300]: " + JSON.stringify(newJson)); let progress_ring_color_linear_number = new LinearGradient([{color: 0xFFFF0000, offset: 0}, {color: 0xFFFFFFFF, offset: 1}]); - try { - var eventData = { - data: { - "progress_ring_color_linear_number": progress_ring_color_linear_number - } - } - var innerEvent = { - eventId: 183, - priority: events_emitter.EventPriority.LOW - } - console.info("[ArkUI_Stage_Progress_Ring_Color_4300] start to publish emit"); - events_emitter.emit(innerEvent, eventData); - } catch (err) { - console.log("[ArkUI_Stage_Progress_Ring_Color_4300] change component data error: " + err.message); - } + globalThis.value.message.notify({name:'progress_ring_color_linear_number',value:progress_ring_color_linear_number}); + await Utils.sleep(2000); let strJson = getInspectorByKey('progress_capsule_color_linear_number'); @@ -5351,21 +5065,7 @@ export default function progressSecTest() { console.info("[ArkUI_Stage_Progress_Ring_Color_4400]: " + JSON.stringify(newJson)); let progress_ring_color_linear_string = new LinearGradient([{color: '#FFFF9A35', offset: 0}, {color: '#FFFFFFFF', offset: 1}]); - try { - var eventData = { - data: { - "progress_ring_color_linear_string": progress_ring_color_linear_string - } - } - var innerEvent = { - eventId: 183, - priority: events_emitter.EventPriority.LOW - } - console.info("[ArkUI_Stage_Progress_Ring_Color_4400] start to publish emit"); - events_emitter.emit(innerEvent, eventData); - } catch (err) { - console.log("[ArkUI_Stage_Progress_Ring_Color_4400] change component data error: " + err.message); - } + globalThis.value.message.notify({name:'progress_ring_color_linear_string',value:progress_ring_color_linear_string}); await Utils.sleep(2000); let strJson = getInspectorByKey('progress_capsule_color_linear_string'); @@ -5388,21 +5088,8 @@ export default function progressSecTest() { console.info("[ArkUI_Stage_Progress_Ring_Color_4500]: " + JSON.stringify(newJson)); let progress_ring_color_linear_color = new LinearGradient([{color: Color.Red, offset: 0}, {color: Color.White, offset: 1}]); - try { - var eventData = { - data: { - "progress_ring_color_linear_color": progress_ring_color_linear_color - } - } - var innerEvent = { - eventId: 183, - priority: events_emitter.EventPriority.LOW - } - console.info("[ArkUI_Stage_Progress_Ring_Color_4500] start to publish emit"); - events_emitter.emit(innerEvent, eventData); - } catch (err) { - console.log("[ArkUI_Stage_Progress_Ring_Color_4500] change component data error: " + err.message); - } + globalThis.value.message.notify({name:'progress_ring_color_linear_color',value:progress_ring_color_linear_color}); + await Utils.sleep(2000); let strJson = getInspectorByKey('progress_capsule_color_linear_color'); @@ -5425,21 +5112,8 @@ export default function progressSecTest() { console.info("[ArkUI_Stage_Progress_Ring_Color_4600]: " + JSON.stringify(newJson)); let progress_ring_color_linear_resource = new LinearGradient([{color: $r('sys.color.ohos_id_color_connected'), offset: 0}, {color: $r('sys.color.ohos_id_color_background'), offset: 1}]); - try { - var eventData = { - data: { - "progress_ring_color_linear_resource": progress_ring_color_linear_resource - } - } - var innerEvent = { - eventId: 183, - priority: events_emitter.EventPriority.LOW - } - console.info("[ArkUI_Stage_Progress_Ring_Color_4600] start to publish emit"); - events_emitter.emit(innerEvent, eventData); - } catch (err) { - console.log("[ArkUI_Stage_Progress_Ring_Color_4600] change component data error: " + err.message); - } + globalThis.value.message.notify({name:'progress_ring_color_linear_resource',value:progress_ring_color_linear_resource}); + await Utils.sleep(2000); let strJson = getInspectorByKey('progress_capsule_color_linear_resource');