From f55c53ce58b18ea69bab0b83e4320745f1eb5c16 Mon Sep 17 00:00:00 2001 From: tengfan Date: Mon, 14 Aug 2023 20:08:58 +0800 Subject: [PATCH] Remove cases of API 11 Signed-off-by: tengfan --- .../entry/src/main/ets/MainAbility/pages/QrCode.ets | 6 ------ .../entry/src/main/ets/test/QrCodeJsunit.test.ets | 10 ++-------- .../src/main/ets/MainAbility/pages/QRCodePage.ets | 5 ----- .../entry/src/main/ets/test/QRCodeJsunit.test.ets | 12 +++--------- 4 files changed, 5 insertions(+), 28 deletions(-) diff --git a/arkui/ace_ets_component_three/entry/src/main/ets/MainAbility/pages/QrCode.ets b/arkui/ace_ets_component_three/entry/src/main/ets/MainAbility/pages/QrCode.ets index b1bdaaf0a..9a0706e7b 100644 --- a/arkui/ace_ets_component_three/entry/src/main/ets/MainAbility/pages/QrCode.ets +++ b/arkui/ace_ets_component_three/entry/src/main/ets/MainAbility/pages/QrCode.ets @@ -114,12 +114,6 @@ struct QrCode { .width(197) .height(197) .key("QrCodeBackgroundColor") - QRCode(`${this.qrCodeValue}`) - .color($r('sys.color.ohos_id_color_foreground')) - .backgroundColor($r('sys.color.ohos_id_color_background')) - .width(197) - .height(197) - .key("QrCodeDefault") } .width('100%') .height('100%') diff --git a/arkui/ace_ets_component_three/entry/src/main/ets/test/QrCodeJsunit.test.ets b/arkui/ace_ets_component_three/entry/src/main/ets/test/QrCodeJsunit.test.ets index b51162a1b..6caa340f8 100644 --- a/arkui/ace_ets_component_three/entry/src/main/ets/test/QrCodeJsunit.test.ets +++ b/arkui/ace_ets_component_three/entry/src/main/ets/test/QrCodeJsunit.test.ets @@ -129,12 +129,9 @@ export default function qrCodeJsunit() { } await Utils.sleep(2000); var strJson = getInspectorByKey('QrCodeColor'); - var strJsonDefault = getInspectorByKey('QrCodeDefault'); var obj = JSON.parse(strJson); - var objDefault = JSON.parse(strJsonDefault); console.info("[test_qrCode_004] component obj is: " + JSON.stringify(obj)); - console.info("[test_qrCode_004] component objDefault is: " + JSON.stringify(objDefault)); - expect(obj.$attrs.color).assertEqual(objDefault.$attrs.color); + expect(obj.$attrs.color).assertEqual('#FF000000'); done(); }); @@ -184,13 +181,10 @@ export default function qrCodeJsunit() { } await Utils.sleep(2000); var strJson = getInspectorByKey('QrCodeColor'); - var strJsonDefault = getInspectorByKey('QrCodeDefault'); var obj = JSON.parse(strJson); - var objDefault = JSON.parse(strJsonDefault); console.info("[test_qrCode_006] component obj is: " + JSON.stringify(obj)); - console.info("[test_qrCode_006] component objDefault is: " + JSON.stringify(objDefault)); // 非法入参默认初始值 - expect(obj.$attrs.backgroundColor).assertEqual(objDefault.$attrs.backgroundColor); + expect(obj.$attrs.backgroundColor).assertEqual('#FFFFFFFF'); done(); }); diff --git a/arkui/ace_ets_component_ui/entry/src/main/ets/MainAbility/pages/QRCodePage.ets b/arkui/ace_ets_component_ui/entry/src/main/ets/MainAbility/pages/QRCodePage.ets index 6a1e9c844..7ca79a21d 100644 --- a/arkui/ace_ets_component_ui/entry/src/main/ets/MainAbility/pages/QRCodePage.ets +++ b/arkui/ace_ets_component_ui/entry/src/main/ets/MainAbility/pages/QRCodePage.ets @@ -60,11 +60,6 @@ struct QRCodePage { Text('backgroundColor').fontSize(9).width('90%').fontColor(0xCCCCCC).fontSize(30) QRCode(this.value).width(200).height(200).backgroundColor(this.backColor).key('qr2') Text(this.text).fontSize(20).margin(10).key('text') - - QRCode(this.value).width(200).height(200) - .color($r('sys.color.ohos_id_color_foreground')) - .backgroundColor($r('sys.color.ohos_id_color_background')) - .key('qrDefault') }.width('100%').margin({ top: 5 }) } } \ No newline at end of file diff --git a/arkui/ace_ets_component_ui/entry/src/main/ets/test/QRCodeJsunit.test.ets b/arkui/ace_ets_component_ui/entry/src/main/ets/test/QRCodeJsunit.test.ets index cea06d408..ad2339564 100644 --- a/arkui/ace_ets_component_ui/entry/src/main/ets/test/QRCodeJsunit.test.ets +++ b/arkui/ace_ets_component_ui/entry/src/main/ets/test/QRCodeJsunit.test.ets @@ -47,15 +47,12 @@ export default function QRCodeJsunit() { // Get the information of the QRCode component console.info('[QRCodeJsunit_0100] START'); let strJson = getInspectorByKey('qr'); - let strJsonDefault = getInspectorByKey('qrDefault'); let obj = JSON.parse(strJson); - let objDefault = JSON.parse(strJsonDefault); console.info("[QRCodeJsunit_0100] component obj is: " + JSON.stringify(obj)); - console.info("[QRCodeJsunit_0100] component objDefault is: " + JSON.stringify(objDefault)); await CommonFunc.sleep(1000); expect(obj.$attrs.value).assertEqual('normal'); - expect(obj.$attrs.color).assertEqual(objDefault.$attrs.color); - expect(obj.$attrs.backgroundColor).assertEqual(objDefault.$attrs.backgroundColor); + expect(obj.$attrs.color).assertEqual('#FF000000'); + expect(obj.$attrs.backgroundColor).assertEqual('#FFFFFFFF'); console.info('[QRCodeJsunit_0100] END'); done(); }); @@ -121,12 +118,9 @@ export default function QRCodeJsunit() { globalThis.value.message.notify({name:'backgroundColor',value:'test'}) await CommonFunc.sleep(2000); let strJson1 = getInspectorByKey('qr2'); - let strJsonDefault = getInspectorByKey('qrDefault'); let obj1 = JSON.parse(strJson1); - let objDefault = JSON.parse(strJsonDefault); console.info("[QRCodeJsunit_0500] component obj1 is: " + JSON.stringify(obj1)); - console.info("[QRCodeJsunit_0500] component objDefault is: " + JSON.stringify(objDefault)); - expect(obj1.$attrs.backgroundColor).assertEqual(objDefault.$attrs.backgroundColor); + expect(obj1.$attrs.backgroundColor).assertEqual('#FFFFFFFF'); console.info('[QRCodeJsunit_0500] END'); done(); }); -- GitLab