From 2eead86a0981a4abad32f79e09f48b9d82735c7f Mon Sep 17 00:00:00 2001 From: hekun Date: Sat, 19 Nov 2022 17:06:35 +0800 Subject: [PATCH] fix the error Signed-off-by: hekun --- .../ets/MainAbility/pages/conponentadd/web.ets | 6 +++--- .../ets/MainAbility/pages/conponentadd/webg.ets | 4 ++-- .../src/main/ets/MainAbility/pages/video.ets | 3 ++- .../src/main/ets/MainAbility/pages/webapi9.ets | 15 ++++++++------- .../entry/src/main/ets/test/sideBar.test.ets | 2 +- .../entry/src/main/ets/test/video.test.ets | 4 +++- .../entry/src/main/ets/test/xcomponent.test.ets | 10 +++++++--- 7 files changed, 26 insertions(+), 18 deletions(-) diff --git a/arkui/ace_ets_component_apilack/entry/src/main/ets/MainAbility/pages/conponentadd/web.ets b/arkui/ace_ets_component_apilack/entry/src/main/ets/MainAbility/pages/conponentadd/web.ets index aab8d1aa2..952a1c545 100644 --- a/arkui/ace_ets_component_apilack/entry/src/main/ets/MainAbility/pages/conponentadd/web.ets +++ b/arkui/ace_ets_component_apilack/entry/src/main/ets/MainAbility/pages/conponentadd/web.ets @@ -250,7 +250,7 @@ struct Index { var origin = this.controller.getPageHeight() var zoomInCalled = false setTimeout(()=>{ - this.controller.zoomIn() + this.newcontroller.zoomIn() if (this.controller.getPageHeight() > origin) { zoomInCalled = true } @@ -383,7 +383,7 @@ struct Index { case "emitSearchAllAsync":{ this.controller.loadUrl({url:"file:///data/storage/el1/bundle/phone/resources/rawfile/index.html"}) setTimeout(()=>{ - this.controller.searchAllAsync("首页"); + this.newcontroller.searchAllAsync("首页"); },3000) break; } @@ -523,7 +523,7 @@ struct Index { case "emitgetUrl":{ try{ setTimeout(() => { - this.controller.getUrl(); + this.newcontroller.getUrl(); Utils.emitEvent('succesful',446) },3000) }catch (error) { diff --git a/arkui/ace_ets_component_apilack/entry/src/main/ets/MainAbility/pages/conponentadd/webg.ets b/arkui/ace_ets_component_apilack/entry/src/main/ets/MainAbility/pages/conponentadd/webg.ets index bbcb0c92f..1cc84627a 100644 --- a/arkui/ace_ets_component_apilack/entry/src/main/ets/MainAbility/pages/conponentadd/webg.ets +++ b/arkui/ace_ets_component_apilack/entry/src/main/ets/MainAbility/pages/conponentadd/webg.ets @@ -219,7 +219,7 @@ struct Index { var origin = this.controller.getPageHeight() var zoomInCalled = false setTimeout(()=>{ - this.controller.zoomIn() + this.newcontroller.zoomIn() if (this.controller.getPageHeight() > origin) { zoomInCalled = true } @@ -358,7 +358,7 @@ struct Index { case "emitSearchAllAsync":{ this.controller.loadUrl({url:"file:///data/storage/el1/bundle/phone/resources/rawfile/index.html"}) setTimeout(()=>{ - this.controller.searchAllAsync("首页"); + this.newcontroller.searchAllAsync("首页"); },3000) break; } diff --git a/arkui/ace_ets_component_apilack/entry/src/main/ets/MainAbility/pages/video.ets b/arkui/ace_ets_component_apilack/entry/src/main/ets/MainAbility/pages/video.ets index 7e7490ef5..b13b4b9b3 100644 --- a/arkui/ace_ets_component_apilack/entry/src/main/ets/MainAbility/pages/video.ets +++ b/arkui/ace_ets_component_apilack/entry/src/main/ets/MainAbility/pages/video.ets @@ -93,7 +93,8 @@ struct VideoOnFullscreenChange { Button("FullScreen") .key("fullScreen") .onClick(() => { - this.controller.requestFullscreen(true) + this.controller.requestFullscreen(true); + console.info("video_101 onClick start to fullScreen"); }); Button("ExitFullScreen") diff --git a/arkui/ace_ets_component_apilack/entry/src/main/ets/MainAbility/pages/webapi9.ets b/arkui/ace_ets_component_apilack/entry/src/main/ets/MainAbility/pages/webapi9.ets index 52aa504a8..5193fab0b 100644 --- a/arkui/ace_ets_component_apilack/entry/src/main/ets/MainAbility/pages/webapi9.ets +++ b/arkui/ace_ets_component_apilack/entry/src/main/ets/MainAbility/pages/webapi9.ets @@ -45,7 +45,8 @@ struct Index { message = new ConsoleMessage("1","12",23,MessageLevel.Debug); - controller:WebController = new WebController() + controller:WebController = new WebController(); + controllerTwo: web_webview.WebviewController = new web_webview.WebviewController(); responseweb: WebResourceResponse = new WebResourceResponse() @State str:string="emitStoreWebArchive" @@ -160,23 +161,23 @@ struct Index { switch(this.str){ // add case "emitGeturl": - let url = this.controller.getUrl(); + let url = this.controllerTwo.getUrl(); Utils.emitEvent(url,810); break; case "emitclearClientAuthenticationCache": - this.controller.clearClientAuthenticationCache(); + this.controllerTwo.clearClientAuthenticationCache(); Utils.emitEvent(this.isVoid,811); break; case "emitclearSslCache": - this.controller.clearSslCache(); + this.controllerTwo.clearSslCache(); Utils.emitEvent(this.isVoid,812); break; case "emitsearchNext": - this.controller.searchNext(true); + this.controllerTwo.searchNext(true); Utils.emitEvent(this.isVoid,813); break; case "emitclearMatches": - this.controller.clearMatches(); + this.controllerTwo.clearMatches(); Utils.emitEvent(this.isVoid,814); break; case "emitDefaultUserAgent": @@ -184,7 +185,7 @@ struct Index { Utils.emitEvent(usrAgent,815); break; case "emitgetWebId": - let webId = this.controller.getWebId(); + let webId = this.controllerTwo.getWebId(); Utils.emitEvent(webId,816); break; case "emitpostMessage": diff --git a/arkui/ace_ets_component_apilack/entry/src/main/ets/test/sideBar.test.ets b/arkui/ace_ets_component_apilack/entry/src/main/ets/test/sideBar.test.ets index 991bec94f..73bdb6e5f 100644 --- a/arkui/ace_ets_component_apilack/entry/src/main/ets/test/sideBar.test.ets +++ b/arkui/ace_ets_component_apilack/entry/src/main/ets/test/sideBar.test.ets @@ -91,7 +91,7 @@ export default function sideBarShowSideBarJsunit() { console.info("[testsideBarShowSideBar0003] component autoHide strJson:" + strJson); let obj = JSON.parse(strJson); expect(obj.$type).assertEqual('SideBarContainer'); - expect(obj.$attrs.sideBarPosition).assertEqual(undefined); + expect(obj.$attrs.sideBarPosition).assertEqual('SideBarPosition.End'); console.info("[testsideBarShowSideBar0003] autoHide value :" + obj.$attrs.autoHide); done(); }); diff --git a/arkui/ace_ets_component_apilack/entry/src/main/ets/test/video.test.ets b/arkui/ace_ets_component_apilack/entry/src/main/ets/test/video.test.ets index 7ae83e2f6..119e66d8d 100644 --- a/arkui/ace_ets_component_apilack/entry/src/main/ets/test/video.test.ets +++ b/arkui/ace_ets_component_apilack/entry/src/main/ets/test/video.test.ets @@ -214,11 +214,13 @@ export default function videoOnFullscreenChangeJsunit() { }catch(err){ console.info("video_101 on events_emitter err : " + JSON.stringify(err)); } - done(); } try { events_emitter.on(innerEvent, callback); + await Utils.sleep(500); console.info("video_101 click result is: " + JSON.stringify(sendEventByKey('fullScreen', 10, ""))); + await Utils.sleep(2000); + done(); } catch (err) { console.info("video_101 on events_emitter err : " + JSON.stringify(err)); } diff --git a/arkui/ace_ets_component_apilack/entry/src/main/ets/test/xcomponent.test.ets b/arkui/ace_ets_component_apilack/entry/src/main/ets/test/xcomponent.test.ets index aa6fa0580..7673cee33 100644 --- a/arkui/ace_ets_component_apilack/entry/src/main/ets/test/xcomponent.test.ets +++ b/arkui/ace_ets_component_apilack/entry/src/main/ets/test/xcomponent.test.ets @@ -62,14 +62,16 @@ export default function xcomponentGetXComponentContextJsunit() { var callback1 = (eventData) => { console.info("onRequestPopupData_0010 get event state result is: " + JSON.stringify(eventData)); expect(eventData.data.STATUS).assertEqual("callBackSuccess"); - done(); } - console.info("onSelect_0012 click result is: " + JSON.stringify(sendEventByKey('getXComponentContextText', 10, ""))); events_emitter.on(innerEventOne, callback1); + await Utils.sleep(1000); + console.info("onSelect_0012 click result is: " + JSON.stringify(sendEventByKey('getXComponentContextText', 10, ""))); + await Utils.sleep(2000); } catch (err) { console.info("onRequestPopupData_0010 on events_emitter err : " + JSON.stringify(err)); } console.info('testxcomponentGetXComponentContext0010 END'); + done(); }); /* @@ -80,7 +82,8 @@ export default function xcomponentGetXComponentContextJsunit() { it('testxcomponentSetXComponentSurfaceSize0001', 0, async function (done) { console.info('xcomponentSetXComponentContext testxcomponentSetXComponentSurfaceSize0001 START'); await Utils.sleep(2000); - console.info("setXComponentSurfaceSize0001 click result is: " + JSON.stringify(sendEventByKey('setXComponentSurfaceSizeText', 10, ""))) + console.info("setXComponentSurfaceSize0001 click result is: " + JSON.stringify(sendEventByKey('setXComponentSurfaceSizeText', 10, ""))); + await Utils.sleep(2000); let strJson = getInspectorByKey('setXComponentSurfaceSizeText'); //console let obj = JSON.parse(strJson); @@ -99,6 +102,7 @@ export default function xcomponentGetXComponentContextJsunit() { console.info('xcomponentSetXComponentContext testxcomponentSetXComponentSurfaceSize0002 START'); await Utils.sleep(2000); console.info("testxcomponentSetXComponentSurfaceSize0002 click result is: " + JSON.stringify(sendEventByKey('setXComponentSurfaceSizeText', 10, ""))) + await Utils.sleep(2000); let strJson = getInspectorByKey('setXComponentSurfaceSizeText'); //console let obj = JSON.parse(strJson); -- GitLab