From ec7c927a2e162cf3c7df5d0657b39ec0451e5176 Mon Sep 17 00:00:00 2001 From: e Date: Wed, 10 May 2023 17:41:34 +0800 Subject: [PATCH] =?UTF-8?q?Signed-off-by:=20e=20=20=E6=B7=BB=E5=8A=A0=E6=8E=A5=E5=8F=A32=E7=94=A8=E4=BE=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ets/MainAbility/pages/webViewHasImage.ets | 169 ++++++++ .../ets/MainAbility/pages/webViewScrollBy.ets | 368 ++++++++++++++++++ .../ets/MainAbility/pages/webViewScrollTo.ets | 235 +++++++++++ .../entry/src/main/ets/test/List.test.ets | 6 + .../ets/test/webViewHasImageJsunit.test.ets | 134 +++++++ .../ets/test/webViewSrollByJsunit.test.ets | 200 ++++++++++ .../ets/test/webViewSrollToJsunit.test.ets | 144 +++++++ .../resources/base/profile/main_pages.json | 5 +- .../main/resources/rawfile/hasImageOne.html | 74 ++++ .../main/resources/rawfile/hasImageTwo.html | 23 ++ .../src/main/resources/rawfile/theScroll.html | 53 +++ 11 files changed, 1410 insertions(+), 1 deletion(-) create mode 100644 arkui/ace_ets_web_dev_webviewController/entry/src/main/ets/MainAbility/pages/webViewHasImage.ets create mode 100644 arkui/ace_ets_web_dev_webviewController/entry/src/main/ets/MainAbility/pages/webViewScrollBy.ets create mode 100644 arkui/ace_ets_web_dev_webviewController/entry/src/main/ets/MainAbility/pages/webViewScrollTo.ets create mode 100644 arkui/ace_ets_web_dev_webviewController/entry/src/main/ets/test/webViewHasImageJsunit.test.ets create mode 100644 arkui/ace_ets_web_dev_webviewController/entry/src/main/ets/test/webViewSrollByJsunit.test.ets create mode 100644 arkui/ace_ets_web_dev_webviewController/entry/src/main/ets/test/webViewSrollToJsunit.test.ets create mode 100644 arkui/ace_ets_web_dev_webviewController/entry/src/main/resources/rawfile/hasImageOne.html create mode 100644 arkui/ace_ets_web_dev_webviewController/entry/src/main/resources/rawfile/hasImageTwo.html create mode 100644 arkui/ace_ets_web_dev_webviewController/entry/src/main/resources/rawfile/theScroll.html diff --git a/arkui/ace_ets_web_dev_webviewController/entry/src/main/ets/MainAbility/pages/webViewHasImage.ets b/arkui/ace_ets_web_dev_webviewController/entry/src/main/ets/MainAbility/pages/webViewHasImage.ets new file mode 100644 index 000000000..f2941e5b3 --- /dev/null +++ b/arkui/ace_ets_web_dev_webviewController/entry/src/main/ets/MainAbility/pages/webViewHasImage.ets @@ -0,0 +1,169 @@ +/** + * Copyright (c) 2023 iSoftStone Information Technology (Group) 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. + */ +import events_emitter from '@ohos.events.emitter'; +import AbilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry'; +import { Hypium } from '@ohos/hypium'; +import testsuite from '../../test/List.test'; +import Utils from '../../test/Utils'; +import web_webview from '@ohos.web.webview'; +let loadedUrl; +@Entry +@Component +struct webViewHasImage { + controller: web_webview.WebviewController = new web_webview.WebviewController(); + @State str:string="emitHasImagePm"; + @State webId:number=0; + @State hasImagePm:boolean=true; + @State hasImagePmSvg:boolean=true; + @State hasImagePmOnline:boolean=true; + @State hasImageCb:boolean=true; + @State hasImageCbSvg:boolean=true; + @State hasImageCbOnline:boolean=true; + @State javaScriptAccess:boolean=true; + @State fileAccess:boolean=true; + @State domStorageAccess:boolean=false; + @State imageAccess:boolean=true; + @State onlineImageAccess:boolean=false; + @State databaseAccess:boolean=true; + onPageShow(){ + let valueChangeEvent={ + eventId:10, + priority:events_emitter.EventPriority.LOW + } + events_emitter.on(valueChangeEvent,this.valueChangeCallBack) + } + private valueChangeCallBack=(eventData)=>{ + console.info("web page valueChangeCallBack"); + if(eventData != null){ + console.info("valueChangeCallBack:"+ JSON.stringify(eventData)); + if(eventData.data.ACTION != null){ + this.str = eventData.data.ACTION; + } + } + } + build(){ + Column(){ + Row() { + Button("web click").key('webImagecomponent').onClick(async () => { + console.info("key==>" + this.str) + switch (this.str) { + case "emitHasImagePm": { + try { + this.controller.hasImage().then((data) => { + console.info('HasImagePm: ' + data); + this.hasImagePm = data; + }) + .catch(function (error) { + console.error("error: " + error); + }) + } catch (error) { + console.error(`Errorcode: ${error.code}, Message: ${error.message}`); + } + Utils.emitEvent(this.hasImagePm, 202); + } + case "emitHasImagePmSvg": { + this.controller.loadUrl($rawfile('hasImageTwo.html')) + await Utils.sleep(2000) + try { + this.controller.hasImage().then((data) => { + console.info('HasImagePmSvg: ' + data); + this.hasImagePmSvg = data; + }) + .catch(function (error) { + console.error("error: " + error); + }) + } catch (error) { + console.error(`Errorcode: ${error.code}, Message: ${error.message}`); + } + Utils.emitEvent(this.hasImagePmSvg, 204); + } + case "emitHasImagePmOnline": { + this.controller.loadUrl($rawfile('onlineImageAccess.html')) + try { + this.controller.hasImage().then((data) => { + console.info('HasImagePmOnline: ' + data); + this.hasImagePmOnline = data; + }) + .catch(function (error) { + console.error("error: " + error); + }) + } catch (error) { + console.error(`Errorcode: ${error.code}, Message: ${error.message}`); + } + Utils.emitEvent(this.hasImagePmOnline, 206); + } + case "emitHasImageCb": { + this.controller.loadUrl($rawfile('hasImageOne.html')) + try { + this.controller.hasImage((error, data) => { + if (error) { + console.info(`hasImageCb error: ` + JSON.stringify(error)) + return + } + this.hasImageCb = data; + console.info("hasImageCb: " + data); + }); + } catch (error) { + console.error(`ErrorCode: ${error.code}, Message: ${error.message}`); + } + Utils.emitEvent(this.hasImageCb, 208); + } + case "emitHasImageCbSvg": { + this.controller.loadUrl($rawfile('hasImageTwo.html')) + await Utils.sleep(2000) + try { + this.controller.hasImage((error, data) => { + if (error) { + console.info(`hasImageCbSvg error: ` + JSON.stringify(error)) + return; + } + this.hasImageCbSvg = data; + console.info("hasImageCbSvg: " + data); + }); + } catch (error) { + console.error(`ErrorCode: ${error.code}, Message: ${error.message}`); + } + Utils.emitEvent(this.hasImageCbSvg, 210); + } + case "emitHasImageCbOnline": { + this.controller.loadUrl($rawfile('onlineImageAccess.html')) + try { + this.controller.hasImage((error, data) => { + if (error) { + console.info(`hasImageCbOnline error: ` + JSON.stringify(error)) + return; + } + this.hasImageCbOnline = data; + console.info("hasImageCbOnline: " + data); + }); + } catch (error) { + console.error(`ErrorCode: ${error.code}, Message: ${error.message}`); + } + Utils.emitEvent(this.hasImageCbOnline, 212); + } + } + }) + } + Web({src:$rawfile('hasImageOne.html'),controller:this.controller}) + .javaScriptAccess(this.javaScriptAccess) + .fileAccess(this.fileAccess) + .imageAccess(this.imageAccess) + .domStorageAccess(this.domStorageAccess) + .onlineImageAccess(this.onlineImageAccess) + .databaseAccess(this.databaseAccess) + + } + } +} diff --git a/arkui/ace_ets_web_dev_webviewController/entry/src/main/ets/MainAbility/pages/webViewScrollBy.ets b/arkui/ace_ets_web_dev_webviewController/entry/src/main/ets/MainAbility/pages/webViewScrollBy.ets new file mode 100644 index 000000000..fe1bdbfb7 --- /dev/null +++ b/arkui/ace_ets_web_dev_webviewController/entry/src/main/ets/MainAbility/pages/webViewScrollBy.ets @@ -0,0 +1,368 @@ +/** + * Copyright (c) 2023 iSoftStone Information Technology (Group) 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. + */ +import events_emitter from '@ohos.events.emitter'; +import AbilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry'; +import { Hypium } from '@ohos/hypium'; +import testsuite from '../../test/List.test'; +import Utils from '../../test/Utils'; +import web_webview from '@ohos.web.webview'; +let loadedUrl; +@Entry +@Component +struct webViewScrollBy { + controller: web_webview.WebviewController = new web_webview.WebviewController(); + @State str:string="emitScrollByOne"; + @State res:boolean = false; + @State xNum:number = 0; + @State yNum:number = 0; + onPageShow(){ + let valueChangeEvent={ + eventId:10, + priority:events_emitter.EventPriority.LOW + } + events_emitter.on(valueChangeEvent,this.valueChangeCallBack) + } + private valueChangeCallBack=(eventData)=>{ + console.info("web page valueChangeCallBack"); + if(eventData != null){ + console.info("valueChangeCallBack:"+ JSON.stringify(eventData)); + if(eventData.data.ACTION != null){ + this.str = eventData.data.ACTION; + } + } + } + build(){ + Column(){ + Row() { + Button("web click").key('webcomponentScrollBy').onClick(async () => { + console.info("key==>" + this.str) + switch (this.str) { + case "emitScrollByOne" :{ + this.controller.loadUrl($rawfile('theScroll.html')) + this.xNum = 0; + this.yNum = 1717; + await Utils.sleep(1000); + try { + this.controller.scrollBy(this.xNum, this.yNum); + await Utils.sleep(1000); + } catch (error) { + console.error(`ErrorCode: ${error.code}, Message: ${error.message}`); + } + this.controller.runJavaScript("getScroll()", (error, result) => { + if (error) { + console.info(`emitScrollByOne runJavaScript error: ` + JSON.stringify(error)) + return; + } else { + console.log("emitScrollByOne runJavaScript.result: " + result); + if(JSON.parse(result)[0] == 0 && JSON.parse(result)[1] > 0){ + this.res = true; + }else{ + this.res = false; + } + } + Utils.emitEvent(this.res, 228) + console.info("emitScrollByOne res: " + result); + }) + break; + } + case "emitScrollByTwo" :{ + this.controller.loadUrl($rawfile('theScroll.html')); + this.xNum = 0; + this.yNum = 3500; + await Utils.sleep(1000); + try { + this.controller.scrollBy(this.xNum, this.yNum); + await Utils.sleep(1000); + } catch (error) { + console.error(`ErrorCode: ${error.code}, Message: ${error.message}`); + } + this.controller.runJavaScript("getScroll()", (error, result) => { + if (error) { + console.info(`emitScrollByTwo runJavaScript error: ` + JSON.stringify(error)) + return; + } else { + console.log("emitScrollByTwo runJavaScript.result: " + result); + if(JSON.parse(result)[0] == 0 && JSON.parse(result)[1] > 200){ + this.res = true; + }else{ + this.res = false; + } + } + Utils.emitEvent(this.res, 230) + console.info("emitScrollByTwo res: " + result); + }) + break; + } + case "emitScrollByThree" :{ + this.controller.loadUrl($rawfile('theScroll.html')); + this.xNum = 0; + this.yNum = -1717; + await Utils.sleep(1000); + try { + this.controller.scrollBy(this.xNum, this.yNum); + await Utils.sleep(1000) + } catch (error) { + console.error(`ErrorCode: ${error.code}, Message: ${error.message}`); + } + this.controller.runJavaScript("getScroll()", (error, result) => { + if (error) { + console.info(`emitScrollByThree runJavaScript error: ` + JSON.stringify(error)) + return; + } else { + console.log("emitScrollByThree runJavaScript.result: " + result); + } + Utils.emitEvent(result, 232) + console.info("emitScrollByThree res: " + result); + }) + break; + } + case "emitScrollByFour" :{ + this.controller.loadUrl($rawfile('theScroll.html')); + this.xNum = 0; + this.yNum = -3500; + await Utils.sleep(1000); + try { + this.controller.scrollBy(this.xNum, this.yNum); + await Utils.sleep(1000) + } catch (error) { + console.error(`ErrorCode: ${error.code}, Message: ${error.message}`); + } + this.controller.runJavaScript("getScroll()", (error, result) => { + if (error) { + console.info(`emitScrollByFour runJavaScript error: ` + JSON.stringify(error)) + return; + } else { + console.log("emitScrollByFour runJavaScript.result: " + result); + } + Utils.emitEvent(result, 234) + console.info("emitScrollByFour res: " + result); + }) + break; + } + case "emitScrollByFive" :{ + this.controller.loadUrl($rawfile('theScroll.html')); + this.xNum = 1500; + this.yNum = 0; + await Utils.sleep(1000); + try { + this.controller.scrollBy(this.xNum, this.yNum); + await Utils.sleep(1000) + } catch (error) { + console.error(`ErrorCode: ${error.code}, Message: ${error.message}`); + } + this.controller.runJavaScript("getScroll()", (error, result) => { + if (error) { + console.info(`emitScrollByFive runJavaScript error: ` + JSON.stringify(error)) + return; + } else { + console.log("emitScrollByFive runJavaScript.result: " + result); + if(JSON.parse(result)[0] > 0 && JSON.parse(result)[1] == 0){ + this.res = true; + }else{ + this.res = false; + } + } + Utils.emitEvent(this.res, 236) + console.info("emitScrollByFive res: " + result); + }) + break; + } + case "emitScrollBySix" :{ + this.controller.loadUrl($rawfile('theScroll.html')) + this.xNum = 4000; + this.yNum = 0; + await Utils.sleep(1000); + try { + this.controller.scrollBy(this.xNum, this.yNum); + await Utils.sleep(1000) + } catch (error) { + console.error(`ErrorCode: ${error.code}, Message: ${error.message}`); + } + this.controller.runJavaScript("getScroll()", (error, result) => { + if (error) { + console.info(`emitScrollBySix runJavaScript error: ` + JSON.stringify(error)) + return; + } else { + console.log("emitScrollBySix runJavaScript.result: " + result); + if(JSON.parse(result)[0] > 200 && JSON.parse(result)[1] == 0){ + this.res = true; + }else{ + this.res = false; + } + } + Utils.emitEvent(this.res, 238) + console.info("emitScrollBySix res: " + result); + }) + break; + } + case "emitScrollBySeven" :{ + this.controller.loadUrl($rawfile('theScroll.html')) + this.xNum = -4000; + this.yNum = 0; + await Utils.sleep(1000); + try { + this.controller.scrollBy(this.xNum, this.yNum); + await Utils.sleep(1000) + } catch (error) { + console.error(`ErrorCode: ${error.code}, Message: ${error.message}`); + } + this.controller.runJavaScript("getScroll()", (error, result) => { + if (error) { + console.info(`emitScrollBySeven runJavaScript error: ` + JSON.stringify(error)) + return; + } else { + console.log("emitScrollBySeven runJavaScript.result: " + result); + } + Utils.emitEvent(result, 240) + console.info("emitScrollBySeven res: " + result); + }) + break; + } + case "emitScrollByEight" :{ + this.controller.loadUrl($rawfile('theScroll.html')) + this.xNum = -1500; + this.yNum = 0; + await Utils.sleep(1000); + try { + this.controller.scrollBy(this.xNum, this.yNum); + await Utils.sleep(1000) + } catch (error) { + console.error(`ErrorCode: ${error.code}, Message: ${error.message}`); + } + this.controller.runJavaScript("getScroll()", (error, result) => { + if (error) { + console.info(`emitScrollByEight runJavaScript error: ` + JSON.stringify(error)) + return; + } else { + console.log("emitScrollByEight runJavaScript.result: " + result); + } + Utils.emitEvent(result, 242) + console.info("emitScrollByEight res: " + result); + }) + break; + } + case "emitScrollByNine" :{ + this.controller.loadUrl($rawfile('theScroll.html')) + this.xNum = 1500; + this.yNum = 1717; + await Utils.sleep(1000); + try { + this.controller.scrollBy(this.xNum, this.yNum); + await Utils.sleep(1000) + } catch (error) { + console.error(`ErrorCode: ${error.code}, Message: ${error.message}`); + } + this.controller.runJavaScript("getScroll()", (error, result) => { + if (error) { + console.info(`emitScrollByNine runJavaScript error: ` + JSON.stringify(error)) + return; + } else { + console.log("emitScrollByNine runJavaScript.result: " + result); + if(JSON.parse(result)[0] > 0 && JSON.parse(result)[1] > 0){ + this.res = true; + }else{ + this.res = false; + } + } + Utils.emitEvent(this.res, 244) + console.info("emitScrollByNine res: " + result); + }) + break; + } + case "emitScrollByTen" :{ + this.controller.loadUrl($rawfile('theScroll.html')); + this.xNum = 4000; + this.yNum = 3500; + await Utils.sleep(1000); + try { + this.controller.scrollBy(this.xNum, this.yNum); + await Utils.sleep(1000) + } catch (error) { + console.error(`ErrorCode: ${error.code}, Message: ${error.message}`); + } + this.controller.runJavaScript("getScroll()", + (error, result) => { + if (error) { + console.info(`emitScrollByTen runJavaScript error: ` + JSON.stringify(error)) + return; + } else { + console.log("emitScrollByTen runJavaScript.result: " + result); + if(JSON.parse(result)[0] > 200 && JSON.parse(result)[1] > 200){ + this.res = true; + }else{ + this.res = false; + } + } + Utils.emitEvent(this.res, 246) + console.info("emitScrollByTen res: " + result); + }) + break; + } + case "emitScrollByEleven" :{ + this.controller.loadUrl($rawfile('theScroll.html')); + this.xNum = -1500; + this.yNum = -1717; + await Utils.sleep(1000); + try { + this.controller.scrollBy(this.xNum, this.yNum); + await Utils.sleep(1000) + } catch (error) { + console.error(`ErrorCode: ${error.code}, Message: ${error.message}`); + } + this.controller.runJavaScript("getScroll()", + (error, result) => { + if (error) { + console.info(`emitScrollByEleven runJavaScript error: ` + JSON.stringify(error)) + return; + } else { + console.log("emitScrollByEleven runJavaScript.result: " + result); + Utils.emitEvent(result, 248) + } + Utils.emitEvent(result, 248) + console.info("emitScrollByEleven res: " + result); + }) + break; + } + case "emitScrollByTwelve" :{ + this.controller.loadUrl($rawfile('theScroll.html')); + this.xNum = -4000; + this.yNum = -3500; + await Utils.sleep(1000); + try { + this.controller.scrollBy(this.xNum, this.yNum); + await Utils.sleep(1000) + } catch (error) { + console.error(`ErrorCode: ${error.code}, Message: ${error.message}`); + } + this.controller.runJavaScript("getScroll()", + (error, result) => { + if (error) { + console.info(`emitScrollByTwelve runJavaScript error: ` + JSON.stringify(error)) + return; + } else { + console.log("emitScrollByTwelve runJavaScript.result: " + result); + } + Utils.emitEvent(result, 250) + console.info("emitScrollByTwelve res: " + result); + }) + break; + } + } + }) + } + Web({src:$rawfile('theScroll.html'),controller:this.controller}) + } + } +} diff --git a/arkui/ace_ets_web_dev_webviewController/entry/src/main/ets/MainAbility/pages/webViewScrollTo.ets b/arkui/ace_ets_web_dev_webviewController/entry/src/main/ets/MainAbility/pages/webViewScrollTo.ets new file mode 100644 index 000000000..e99c43e97 --- /dev/null +++ b/arkui/ace_ets_web_dev_webviewController/entry/src/main/ets/MainAbility/pages/webViewScrollTo.ets @@ -0,0 +1,235 @@ +/** + * Copyright (c) 2023 iSoftStone Information Technology (Group) 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. + */ +import events_emitter from '@ohos.events.emitter'; +import AbilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry'; +import { Hypium } from '@ohos/hypium'; +import testsuite from '../../test/List.test'; +import Utils from '../../test/Utils'; +import web_webview from '@ohos.web.webview'; + +let loadedUrl; +@Entry +@Component +struct webViewScrollTo { + controller: web_webview.WebviewController = new web_webview.WebviewController(); + @State str:string="emitScrollToOne"; + @State res:boolean = false; + @State xNum:number = 0; + @State yNum:number = 0; + onPageShow(){ + let valueChangeEvent={ + eventId:10, + priority:events_emitter.EventPriority.LOW + } + events_emitter.on(valueChangeEvent,this.valueChangeCallBack) + } + private valueChangeCallBack=(eventData)=>{ + console.info("web page valueChangeCallBack"); + if(eventData != null){ + console.info("valueChangeCallBack:"+ JSON.stringify(eventData)); + if(eventData.data.ACTION != null){ + this.str = eventData.data.ACTION; + } + } + } + build(){ + Column(){ + Row() { + Button("web click").key('webcomponentScrolTo').onClick(async () => { + console.info("key==>" + this.str) + switch (this.str) { + case "emitScrollToOne" :{ + this.controller.loadUrl($rawfile('theScroll.html')); + this.xNum = -10; + this.yNum = -10; + await Utils.sleep(1000); + try { + this.controller.scrollTo(this.xNum, this.yNum); + await Utils.sleep(1000); + } catch (error) { + console.error(`ErrorCode: ${error.code}, Message: ${error.message}`); + } + this.controller.runJavaScript("getScroll()",(error, result) => { + if (error) { + console.info(`emitScrollToOne runJavaScript error: ` + JSON.stringify(error)) + return; + } else { + console.log("emitScrollToOne runJavaScript.result: " + result); + } + Utils.emitEvent(result, 214) + console.info("emitScrollToOne res: " + result); + }) + break; + } + case "emitScrollToTwo" :{ + this.controller.loadUrl($rawfile('theScroll.html')); + this.xNum = -10; + this.yNum = 3500; + await Utils.sleep(1000); + try { + this.controller.scrollTo(this.xNum, this.yNum); + await Utils.sleep(1000); + } catch (error) { + console.error(`ErrorCode: ${error.code}, Message: ${error.message}`); + } + this.controller.runJavaScript("getScroll()",(error, result) => { + if (error) { + console.info(`emitScrollToTwo runJavaScript error: ` + JSON.stringify(error)) + return; + } else { + console.log("emitScrollToTwo runJavaScript.result: " + result); + if(JSON.parse(result)[0] == 0 && JSON.parse(result)[1] > 200){ + this.res = true; + }else{ + this.res = false; + } + } + Utils.emitEvent(this.res, 216) + console.info("emitScrollToTwo res: " + result); + }) + break; + } + case "emitScrollToThree" :{ + this.controller.loadUrl($rawfile('theScroll.html')); + this.xNum = -10; + this.yNum = 200; + await Utils.sleep(1000); + try { + this.controller.scrollTo(this.xNum, this.yNum); + await Utils.sleep(1000); + } catch (error) { + console.error(`ErrorCode: ${error.code}, Message: ${error.message}`); + } + this.controller.runJavaScript("getScroll()",(error, result) => { + if (error) { + console.info(`emitScrollToThree runJavaScript error: ` + JSON.stringify(error)) + return; + } else { + console.log("emitScrollToThree runJavaScript.result: " + result); + } + Utils.emitEvent(result, 218) + console.info("emitScrollToThree res: " + result); + }) + break; + } + case "emitScrollToFour" :{ + this.controller.loadUrl($rawfile('theScroll.html')); + this.xNum = 200; + this.yNum = -10; + await Utils.sleep(1000); + try { + this.controller.scrollTo(this.xNum, this.yNum); + await Utils.sleep(1000) + } catch (error) { + console.error(`ErrorCode: ${error.code}, Message: ${error.message}`); + } + this.controller.runJavaScript("getScroll()", (error, result) => { + if (error) { + console.info(`emitScrollToFour runJavaScript error: ` + JSON.stringify(error)) + return; + } else { + console.log("emitScrollToFour runJavaScript.result: " + result); + } + Utils.emitEvent(result, 220) + console.info("emitScrollToFour res: " + result); + }) + break; + } + case "emitScrollToFive" :{ + this.controller.loadUrl($rawfile('theScroll.html')); + this.xNum = 4000; + this.yNum = -10; + await Utils.sleep(1000); + try { + this.controller.scrollTo(this.xNum, this.yNum); + await Utils.sleep(1000) + } catch (error) { + console.error(`ErrorCode: ${error.code}, Message: ${error.message}`); + } + this.controller.runJavaScript("getScroll()", (error, result) => { + if (error) { + console.info(`emitScrollToFive runJavaScript error: ` + JSON.stringify(error)) + return; + } else { + console.log("emitScrollToFive runJavaScript.result: " + result); + if(JSON.parse(result)[0] > 200 && JSON.parse(result)[1] == 0){ + this.res = true; + }else{ + this.res = false; + } + } + Utils.emitEvent(this.res, 222) + console.info("emitScrollToFive res: " + result); + }) + break; + } + case "emitScrollToSix" :{ + this.controller.loadUrl($rawfile('theScroll.html')); + this.xNum = 200; + this.yNum = 200; + await Utils.sleep(1000); + try { + this.controller.scrollTo(this.xNum, this.yNum); + await Utils.sleep(1000) + } catch (error) { + console.error(`ErrorCode: ${error.code}, Message: ${error.message}`); + } + this.controller.runJavaScript("getScroll()", (error, result) => { + if (error) { + console.info(`emitScrollToSix runJavaScript error: ` + JSON.stringify(error)) + return; + } else { + console.log("emitScrollToSix runJavaScript.result: " + result); + } + Utils.emitEvent(result, 224) + console.info("emitScrollToSix res: " + result); + }) + break; + } + case "emitScrollToSeven" :{ + this.controller.loadUrl($rawfile('theScroll.html')); + this.xNum = 4000; + this.yNum = 3500; + await Utils.sleep(1000); + try { + this.controller.scrollTo(this.xNum, this.yNum); + await Utils.sleep(1000) + } catch (error) { + console.error(`ErrorCode: ${error.code}, Message: ${error.message}`); + } + this.controller.runJavaScript("getScroll()", (error, result) => { + if (error) { + console.info(`emitScrollToSeven runJavaScript error: ` + JSON.stringify(error)) + return; + } else { + console.log("emitScrollToSeven runJavaScript.result: " + result); + if(JSON.parse(result)[0] > 200 && JSON.parse(result)[1] > 200){ + this.res = true; + }else{ + this.res = false; + } + } + Utils.emitEvent(this.res, 226) + console.info("emitScrollToSeven res: " + result); + }) + break; + } + } + }) + } + Web({src:$rawfile('theScroll.html'),controller:this.controller}) + } + } +} diff --git a/arkui/ace_ets_web_dev_webviewController/entry/src/main/ets/test/List.test.ets b/arkui/ace_ets_web_dev_webviewController/entry/src/main/ets/test/List.test.ets index 0f9eecc81..6c15331a3 100644 --- a/arkui/ace_ets_web_dev_webviewController/entry/src/main/ets/test/List.test.ets +++ b/arkui/ace_ets_web_dev_webviewController/entry/src/main/ets/test/List.test.ets @@ -16,9 +16,15 @@ import webViewControllerJsunit from './webViewControllerJsunit.test' import webViewOnWindowNewJsunit from './WebViewOnWindowNewJsunit.test' import webViewOnErrorReceive02Jsunit from './WebViewOnErrorReceive02Jsunit.test' import webViewOnErrorReceive03Jsunit from './WebViewOnErrorReceive03Jsunit.test' +import webViewHasImageJsunit from './webViewHasImageJsunit.test' +import webViewSrollToJsunit from './webViewSrollToJsunit.test' +import webViewSrollByJsunit from './webViewSrollByJsunit.test' export default function testsuite() { webViewControllerJsunit() webViewOnWindowNewJsunit() webViewOnErrorReceive02Jsunit() webViewOnErrorReceive03Jsunit() + webViewHasImageJsunit() + webViewSrollToJsunit() + webViewSrollByJsunit() } \ No newline at end of file diff --git a/arkui/ace_ets_web_dev_webviewController/entry/src/main/ets/test/webViewHasImageJsunit.test.ets b/arkui/ace_ets_web_dev_webviewController/entry/src/main/ets/test/webViewHasImageJsunit.test.ets new file mode 100644 index 000000000..5eb6677ea --- /dev/null +++ b/arkui/ace_ets_web_dev_webviewController/entry/src/main/ets/test/webViewHasImageJsunit.test.ets @@ -0,0 +1,134 @@ +/** + * Copyright (c) 2023 iSoftStone Information Technology (Group) 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. + */ +// @ts-nocheck +import { describe, beforeEach, afterEach, it, expect } from "@ohos/hypium"; +import events_emitter from '@ohos.events.emitter'; +import Utils from './Utils.ets'; +let emitKey = "emitHasImagePm"; +import router from '@system.router'; +export default function webViewHasImageJsunit() { + describe('ActsAcewebViewHasImageJsunitTest', function () { + beforeAll(async function (done) { + let options = { + uri: "MainAbility/pages/webViewHasImage" + } + try { + router.clear(); + let pages = router.getState(); + console.info("get webViewHasImage state success " + JSON.stringify(pages)); + if (!("webViewHasImage" == pages.name)) { + console.info("get webViewHasImage state success " + JSON.stringify(pages.name)); + let result = await router.push(options); + await Utils.sleep(2000); + console.info("push webViewHasImage page success " + JSON.stringify(result)); + } + } catch (err) { + console.error("push webViewHasImage page error: " + err); + } + done() + }); + beforeEach(async function (done) { + await Utils.sleep(2000); + console.info("web beforeEach start"); + done(); + }) + afterEach(async function (done) { + console.info("web afterEach start:"+emitKey); + try { + let backData = { + data: { + "ACTION": emitKey + } + } + let backEvent = { + eventId:10, + priority:events_emitter.EventPriority.LOW + } + console.info("start send emitKey"); + events_emitter.emit(backEvent, backData); + } catch (err) { + console.info("emit emitKey err: " + JSON.stringify(err)); + } + await Utils.sleep(2000); + done(); + }) + /* + * tc.number SUB_ACE_BASIC_ETS_API_TESTHASIMAGE_0100 + * tc.name testHasImagePm + * tc.desc There are offline images in the H5 page that are loaded using the img tag, and the interface + * hasImage:Promise results in true + */ + it('testHasImagePm',0,async function(done){ + emitKey="emitHasImagePmSvg"; + Utils.registerEvent("testHasImagePm",true,202,done); + sendEventByKey('webImagecomponent',10,''); + }) + /* + * tc.number SUB_ACE_BASIC_ETS_API_TESTHASIMAGE_0200 + * tc.name testHasImagePmSvg + * tc.desc There is no image loaded using the img tag in the H5 page, only svg, and the interface + * hasImage:Promise result is false + */ + it('testHasImagePmSvg',0,async function(done){ + emitKey="emitHasImagePmOnline"; + Utils.registerEvent("testHasImageSvg",false,204,done); + sendEventByKey('webImagecomponent',10,''); + }) + /* + * tc.number SUB_ACE_BASIC_ETS_API_TESTHASIMAGE_0300 + * tc.name testHasImagePmOnline + * tc.desc The H5 page has an online web page loaded using the img tag, and the interface + * hasImage:Promise result is false + */ + it('testHasImagePmOnline',0,async function(done){ + emitKey="emitHasImageCb"; + Utils.registerEvent("testHasImagePmOnline",false,206,done); + sendEventByKey('webImagecomponent',10,''); + }) + /* + * tc.number SUB_ACE_BASIC_ETS_API_TESTHASIMAGE_0400 + * tc.name testHasImageCb + * tc.desc There are offline images in the H5 page that are loaded using the img tag, and the interface + * hasImage:Callback results in true + */ + it('testHasImageCb',0,async function(done){ + emitKey="emitHasImageCbSvg"; + Utils.registerEvent("testHasImageCb",true,208,done); + sendEventByKey('webImagecomponent',10,''); + }) + /* + * tc.number SUB_ACE_BASIC_ETS_API_TESTHASIMAGE_0500 + * tc.name testHasImageCbSvg + * tc.desc There is no image loaded using the img tag in the H5 page, only svg, and the interface + * hasImage:Callback result is false + */ + it('testHasImageCbSvg',0,async function(done){ + emitKey="emitHasImageCbOnline"; + Utils.registerEvent("testHasImageCbSvg",false,210,done); + sendEventByKey('webImagecomponent',10,''); + }) + /* + * tc.number SUB_ACE_BASIC_ETS_API_TESTHASIMAGE_0600 + * tc.name testHasImageCbOnline + * tc.desc The H5 page has an online web page loaded using the img tag, and the interface + * hasImage:Callback result is false + */ + it('testHasImageCbOnline',0,async function(done){ + emitKey="emitHasImageCbOnline"; + Utils.registerEvent("testHasImageCbOnline",false,212,done); + sendEventByKey('webImagecomponent',10,''); + }) + }) +} diff --git a/arkui/ace_ets_web_dev_webviewController/entry/src/main/ets/test/webViewSrollByJsunit.test.ets b/arkui/ace_ets_web_dev_webviewController/entry/src/main/ets/test/webViewSrollByJsunit.test.ets new file mode 100644 index 000000000..6df022217 --- /dev/null +++ b/arkui/ace_ets_web_dev_webviewController/entry/src/main/ets/test/webViewSrollByJsunit.test.ets @@ -0,0 +1,200 @@ +/** + * Copyright (c) 2023 iSoftStone Information Technology (Group) 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. + */ +// @ts-nocheck +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'; +let emitKey = "emitScrollByOne"; +export default function webViewSrollByJsunit() { + describe('ActsAceWebViewScrollByTest', function () { + beforeAll(async function (done) { + let options = { + uri: "MainAbility/pages/webViewScrollBy" + } + try { + router.clear(); + let pages = router.getState(); + console.info("get webViewScroll state success " + JSON.stringify(pages)); + if (!("webViewScrollBy" == pages.name)) { + console.info("get webViewScrollBy state success " + JSON.stringify(pages.name)); + let result = await router.push(options); + await Utils.sleep(2000); + console.info("push webViewScrollBy page success " + JSON.stringify(result)); + } + } catch (err) { + console.error("push webViewScrollBy page error: " + err); + } + done() + }); + beforeEach(async function (done) { + await Utils.sleep(2000); + console.info("webViewScrollBy beforeEach start"); + done(); + }) + afterEach(async function (done) { + console.info("webViewScrollBy afterEach start:"+emitKey); + try { + let backData = { + data: { + "ACTION": emitKey + } + } + let backEvent = { + eventId:10, + priority:events_emitter.EventPriority.LOW + } + console.info("start send emitKey"); + events_emitter.emit(backEvent, backData); + } catch (err) { + console.info("emit emitKey err: " + JSON.stringify(err)); + } + await Utils.sleep(2000); + done(); + }) + /* + * tc.number SUB_ACE_BASIC_ETS_API_TESTSCROLLBY_0100 + * tc.name testScrollByOne + * tc.desc When calling the scrollTo interface, x=0 and the y input parameter is a positive number, + * which is half the page height + */ + it('testScrollByOne',0,async function(done){ + emitKey="emitScrollByTwo"; + Utils.registerEvent("testScrollByOne",true,228,done); + sendEventByKey('webcomponentScrollBy',10,''); + }) + /* + * tc.number SUB_ACE_BASIC_ETS_API_TESTSCROLLBY_0200 + * tc.name testScrollByTwo + * tc.desc When calling the scrollTo interface, x=0 and the y input parameter is a positive number, + * which is greater than the content height + */ + it('testScrollByTwo',0,async function(done){ + emitKey="emitScrollByThree"; + Utils.registerEvent("testScrollByTwo",true,230,done); + sendEventByKey('webcomponentScrollBy',10,''); + }) + /* + * tc.number SUB_ACE_BASIC_ETS_API_TESTSCROLLBY_0300 + * tc.name testScrollByThree + * tc.desc When calling the scrollTo interface, x=0 and the y input parameter is negative, which is half the + * page height + */ + it('testScrollByThree',0,async function(done){ + emitKey="emitScrollByFour"; + Utils.registerEvent("testScrollByThree","[0,0]",232,done); + sendEventByKey('webcomponentScrollBy',10,''); + }) + /* + * tc.number SUB_ACE_BASIC_ETS_API_TESTSCROLLBY_0400 + * tc.name testScrollByFour + * tc.desc When calling the scrollTo interface, x=0 and the y input parameter is negative, exceeding the + * page height + */ + it('testScrollByFour',0,async function(done){ + emitKey="emitScrollByFive"; + Utils.registerEvent("emitScrollByFour","[0,0]",234,done); + sendEventByKey('webcomponentScrollBy',10,''); + }) + /* + * tc.number SUB_ACE_BASIC_ETS_API_TESTSCROLLBY_0500 + * tc.name testScrollByFive + * tc.desc When calling the scrollTo interface, y=0 and the x input parameter is a positive number, which is + * half the page length + */ + it('testScrollByFive',0,async function(done){ + emitKey="emitScrollBySix"; + Utils.registerEvent("testScrollByFive",true,236,done); + sendEventByKey('webcomponentScrollBy',10,''); + }) + /* + * tc.number SUB_ACE_BASIC_ETS_API_TESTSCROLLBY_0600 + * tc.name testScrollBySix + * tc.desc When calling the scrollTo interface, y=0 and the x input parameter is positive, which is + * greater than the page length + */ + it('testScrollBySix',0,async function(done){ + emitKey="emitScrollBySeven"; + Utils.registerEvent("testScrollBySix",true,238,done); + sendEventByKey('webcomponentScrollBy',10,''); + }) + /* + * tc.number SUB_ACE_BASIC_ETS_API_TESTSCROLLBY_0700 + * tc.name testScrollByEight + * tc.desc When calling the scrollTo interface, y=0 and the x input parameter is negative, which is greater + * than the page length + */ + it('testScrollBySeven',0,async function(done){ + emitKey="emitScrollByEight"; + Utils.registerEvent("testScrollBySeven","[0,0]",240,done); + sendEventByKey('webcomponentScrollBy',10,''); + }) + /* + * tc.number SUB_ACE_BASIC_ETS_API_TESTSCROLLBY_0800 + * tc.name testScrollBySeven + * tc.desc When calling the scrollTo interface, y=0 and the x input parameter is negative, which is half the + * page length + */ + it('testScrollByEight',0,async function(done){ + emitKey="emitScrollByNine"; + Utils.registerEvent("testScrollByEight","[0,0]",242,done); + sendEventByKey('webcomponentScrollBy',10,''); + }) + /* + * tc.number SUB_ACE_BASIC_ETS_API_TESTSCROLLBY_0900 + * tc.name testScrollByNine + * tc.desc When calling the scrollTo interface, the yx input parameter is a positive number, which is half + * the width and height of the page + */ + it('testScrollByNine',0,async function(done){ + emitKey="emitScrollByTen"; + Utils.registerEvent("testScrollByNine",true,244,done); + sendEventByKey('webcomponentScrollBy',10,''); + }) + /* + * tc.number SUB_ACE_BASIC_ETS_API_TESTSCROLLBY_1000 + * tc.name testScrollByTen + * tc.desc When the scrollTo interface is called, the yx input parameter is a positive number, which exceeds + * the page width and height + */ + it('testScrollByTen',0,async function(done){ + emitKey="emitScrollByEleven"; + Utils.registerEvent("testScrollByTen",true,246,done); + sendEventByKey('webcomponentScrollBy',10,''); + }) + /* + * tc.number SUB_ACE_BASIC_ETS_API_TESTSCROLLBY_1100 + * tc.name testScrollByEleven + * tc.desc When calling the scrollTo interface, the yx input parameter is negative, which is half the width + * and height of the page + */ + it('testScrollByEleven',0,async function(done){ + emitKey="emitScrollByTwelve"; + Utils.registerEvent("testScrollByEleven","[0,0]",248,done); + sendEventByKey('webcomponentScrollBy',10,''); + }) + /* + * tc.number SUB_ACE_BASIC_ETS_API_TESTSCROLLBY_1200 + * tc.name testScrollByTwelve + * tc.desc When calling the scrollTo interface, the yx input parameter is negative, which exceeds the page + * width and height + */ + it('testScrollByTwelve',0,async function(done){ + emitKey="emitScrollByTwelve"; + Utils.registerEvent("testScrollByTwelve","[0,0]",250,done); + sendEventByKey('webcomponentScrollBy',10,''); + }) + }) +} diff --git a/arkui/ace_ets_web_dev_webviewController/entry/src/main/ets/test/webViewSrollToJsunit.test.ets b/arkui/ace_ets_web_dev_webviewController/entry/src/main/ets/test/webViewSrollToJsunit.test.ets new file mode 100644 index 000000000..c7c860dab --- /dev/null +++ b/arkui/ace_ets_web_dev_webviewController/entry/src/main/ets/test/webViewSrollToJsunit.test.ets @@ -0,0 +1,144 @@ +/** + * Copyright (c) 2023 iSoftStone Information Technology (Group) 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. + */ +// @ts-nocheck +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'; +let emitKey = "emitScrollToOne"; +export default function webViewSrollToJsunit() { + describe('ActsAceWebViewScrollToTest', function () { + beforeAll(async function (done) { + let options = { + uri: "MainAbility/pages/webViewScrollTo" + } + try { + router.clear(); + let pages = router.getState(); + console.info("get webViewScroll state success " + JSON.stringify(pages)); + if (!("webViewScrollTo" == pages.name)) { + console.info("get webViewScrollTo state success " + JSON.stringify(pages.name)); + let result = await router.push(options); + await Utils.sleep(2000); + console.info("push webViewScrollTo page success " + JSON.stringify(result)); + } + } catch (err) { + console.error("push webViewScrollTo page error: " + err); + } + done() + }); + beforeEach(async function (done) { + await Utils.sleep(2000); + console.info("webViewScrollTo beforeEach start"); + done(); + }) + afterEach(async function (done) { + console.info("webViewScrollTo afterEach start:"+emitKey); + try { + let backData = { + data: { + "ACTION": emitKey + } + } + let backEvent = { + eventId:10, + priority:events_emitter.EventPriority.LOW + } + console.info("start send emitKey"); + events_emitter.emit(backEvent, backData); + } catch (err) { + console.info("emit emitKey err: " + JSON.stringify(err)); + } + await Utils.sleep(2000); + done(); + }) + /* + * tc.number SUB_ACE_BASIC_ETS_API_TESTSCROLLTO_0100 + * tc.name testScrollToOne + * tc.desc When calling the scrollTo interface, the x,y input parameters are negative + */ + it('testScrollToOne',0,async function(done){ + emitKey="emitScrollToTwo"; + Utils.registerEvent("testScrollToOne","[0,0]",214,done); + sendEventByKey('webcomponentScrolTo',10,''); + }) + /* + * tc.number SUB_ACE_BASIC_ETS_API_TESTSCROLLTO_0200 + * tc.name testScrollToTwo + * tc.desc When calling the scrollTo interface, the x input parameter is negative and the y input parameter is + * positive, which is greater than the page height + */ + it('testScrollToTwo',0,async function(done){ + emitKey="emitScrollToThree"; + Utils.registerEvent("testScrollToTwo",true,216,done); + sendEventByKey('webcomponentScrolTo',10,''); + }) + /* + * tc.number SUB_ACE_BASIC_ETS_API_TESTSCROLLTO_0300 + * tc.name testScrollToThree + * tc.desc When calling the scrollTo interface, the x input parameter is negative and the y input parameter is + * positive, which is less than the page height + */ + it('testScrollToThree',0,async function(done){ + emitKey="emitScrollToFour"; + Utils.registerEvent("testScrollToThree","[0,200]",218,done); + sendEventByKey('webcomponentScrolTo',10,''); + }) + /* + * tc.number SUB_ACE_BASIC_ETS_API_TESTSCROLLTO_0400 + * tc.name testScrollToFour + * tc.desc When calling the scrollTo interface, the y input parameter is negative and the x input parameter is + * positive, which is less than the page length + */ + it('testScrollToFour',0,async function(done){ + emitKey="emitScrollToFive"; + Utils.registerEvent("testScrollToFour","[200,0]",220,done); + sendEventByKey('webcomponentScrolTo',10,''); + }) + /* + * tc.number SUB_ACE_BASIC_ETS_API_TESTSCROLLTO_0500 + * tc.name testScrollToFive + * tc.desc When calling the scrollTo interface, the y input parameter is negative and the x input parameter is + * positive, which is greater than the page length + */ + it('testScrollToFive',0,async function(done){ + emitKey="emitScrollToSix"; + Utils.registerEvent("testScrollToFive",true,222,done); + sendEventByKey('webcomponentScrolTo',10,''); + }) + /* + * tc.number SUB_ACE_BASIC_ETS_API_TESTSCROLLTO_0600 + * tc.name testScrollToSix + * tc.desc When calling the scrollTo interface, the y input parameter is a positive number and the x input parameter + * is a positive number, both of which are less than the page height + */ + it('testScrollToSix',0,async function(done){ + emitKey="emitScrollToSeven"; + Utils.registerEvent("testScrollToSix","[200,200]",224,done); + sendEventByKey('webcomponentScrolTo',10,''); + }) + /* + * tc.number SUB_ACE_BASIC_ETS_API_TESTSCROLLTO_0700 + * tc.name testScrollToSeven + * tc.desc When the scrollTo interface is called, the y input parameter is a positive number and the x input + * parameter is a positive number, both of which are greater than the page width and height + */ + it('testScrollToSeven',0,async function(done){ + emitKey="emitScrollToSeven"; + Utils.registerEvent("testScrollToSeven",true,226,done); + sendEventByKey('webcomponentScrolTo',10,''); + }) + }) +} diff --git a/arkui/ace_ets_web_dev_webviewController/entry/src/main/resources/base/profile/main_pages.json b/arkui/ace_ets_web_dev_webviewController/entry/src/main/resources/base/profile/main_pages.json index 6e04f1a13..d92824b76 100644 --- a/arkui/ace_ets_web_dev_webviewController/entry/src/main/resources/base/profile/main_pages.json +++ b/arkui/ace_ets_web_dev_webviewController/entry/src/main/resources/base/profile/main_pages.json @@ -3,6 +3,9 @@ "MainAbility/pages/webViewController", "MainAbility/pages/onWindowNew", "MainAbility/pages/onErrorReceive02", - "MainAbility/pages/onErrorReceive03" + "MainAbility/pages/onErrorReceive03", + "MainAbility/pages/webViewHasImage", + "MainAbility/pages/webViewScrollTo", + "MainAbility/pages/webViewScrollBy" ] } \ No newline at end of file diff --git a/arkui/ace_ets_web_dev_webviewController/entry/src/main/resources/rawfile/hasImageOne.html b/arkui/ace_ets_web_dev_webviewController/entry/src/main/resources/rawfile/hasImageOne.html new file mode 100644 index 000000000..b907bb8e5 --- /dev/null +++ b/arkui/ace_ets_web_dev_webviewController/entry/src/main/resources/rawfile/hasImageOne.html @@ -0,0 +1,74 @@ + + + + + + + index + + + +
首页
+
+ 打开rawfile文件 + icon + + + \ No newline at end of file diff --git a/arkui/ace_ets_web_dev_webviewController/entry/src/main/resources/rawfile/hasImageTwo.html b/arkui/ace_ets_web_dev_webviewController/entry/src/main/resources/rawfile/hasImageTwo.html new file mode 100644 index 000000000..0dbf91b9e --- /dev/null +++ b/arkui/ace_ets_web_dev_webviewController/entry/src/main/resources/rawfile/hasImageTwo.html @@ -0,0 +1,23 @@ + + + + + + + second + + +
+ second pages + + + +
+ + + + \ No newline at end of file diff --git a/arkui/ace_ets_web_dev_webviewController/entry/src/main/resources/rawfile/theScroll.html b/arkui/ace_ets_web_dev_webviewController/entry/src/main/resources/rawfile/theScroll.html new file mode 100644 index 000000000..31f137f84 --- /dev/null +++ b/arkui/ace_ets_web_dev_webviewController/entry/src/main/resources/rawfile/theScroll.html @@ -0,0 +1,53 @@ + + + + + homework + + + +
+
+ + + +
+
+
+ icon +
+
+ + + + + -- GitLab