diff --git a/arkui/ace_ets_web_dev/entry/src/main/ets/MainAbility/pages/web.ets b/arkui/ace_ets_web_dev/entry/src/main/ets/MainAbility/pages/web.ets index e3714dc505b438565fc4b453e6b656113a945b4c..630f93a1212df5df3ede663eb6fd0ebfc2c5a769 100644 --- a/arkui/ace_ets_web_dev/entry/src/main/ets/MainAbility/pages/web.ets +++ b/arkui/ace_ets_web_dev/entry/src/main/ets/MainAbility/pages/web.ets @@ -55,6 +55,7 @@ struct Index { @State cacheError:boolean=false @State mixedSwitch:boolean=false @State mixedAllSwitch:boolean=false + @State overViewFalseHeight:number=0 onPageShow(){ let valueChangeEvent={ eventId:10, @@ -512,9 +513,11 @@ struct Index { await Utils.sleep(1000) this.controller.loadUrl({url:"file:///data/storage/el1/bundle/phone/resources/rawfile/overview.html"}) setTimeout(()=>{ + let webPageHeight=this.controller.getPageHeight() this.controller.runJavaScript({script:"getViewResult()",callback:(res)=>{ + this.overViewFalseHeight=parseInt(res) console.info("getViewResult==>"+res) - Utils.emitEventTwo(1150,res,168) + Utils.emitEventTwo(webPageHeight,res,168) }}) },3000) break; @@ -526,7 +529,7 @@ struct Index { setTimeout(()=>{ this.controller.runJavaScript({script:"getViewResult()",callback:(res)=>{ console.info("getViewResult==>"+res) - Utils.emitEventTwo(2350,res,170) + Utils.emitEventTwo(this.overViewFalseHeight,parseInt(res),170) }}) },3000) break; diff --git a/arkui/ace_ets_web_dev/entry/src/main/ets/test/Utils.ets b/arkui/ace_ets_web_dev/entry/src/main/ets/test/Utils.ets index 1a90ba6aedd9cd4c5662f10bd0f033f6136cb61a..d8e0944a8887fe72e3e02cc31b9750c7d24feeda 100644 --- a/arkui/ace_ets_web_dev/entry/src/main/ets/test/Utils.ets +++ b/arkui/ace_ets_web_dev/entry/src/main/ets/test/Utils.ets @@ -132,4 +132,22 @@ export default class Utils { console.info("emit emitKey err: " + JSON.stringify(err)); } } + static registerLargerEvent(testCaseName,eventId,done){ + console.info(`[${testCaseName}] START`); + try{ + let callBack=(backData)=>{ + console.info(`${testCaseName} get result is:`+JSON.stringify(backData)); + expect(backData.data.actualValue).assertLarger(backData.data.expectedValue); + console.info(`[${testCaseName}] END`); + done() + } + let innerEvent = { + eventId:eventId, + priority:events_emitter.EventPriority.LOW + } + events_emitter.on(innerEvent,callBack) + }catch(err){ + console.info(`[${testCaseName}] err:`+JSON.stringify(err)); + } + } } diff --git a/arkui/ace_ets_web_dev/entry/src/main/ets/test/WebJsunit.test.ets b/arkui/ace_ets_web_dev/entry/src/main/ets/test/WebJsunit.test.ets index 5c955c488244e5a7357fbe473943afbecfb25e1d..1e55e2548ac6d2543bf289341e06b068d6a158a1 100644 --- a/arkui/ace_ets_web_dev/entry/src/main/ets/test/WebJsunit.test.ets +++ b/arkui/ace_ets_web_dev/entry/src/main/ets/test/WebJsunit.test.ets @@ -389,7 +389,7 @@ export default function webJsunit() { */ it('overviewModeAccessTrue',0,async function(done){ emitKey="emitOnPrompt"; - Utils.registerEventTwo("overviewModeAccessTrue",170,done); + Utils.registerLargerEvent("overviewModeAccessTrue",170,done); sendEventByKey('webcomponent',10,''); }) /* diff --git a/arkui/ace_ets_web_dev/signature/openharmony_sx.p7b b/arkui/ace_ets_web_dev/signature/openharmony_sx.p7b index 7ffcdc78527c5c1aa24520ab7e913c5f47c703f0..bd2ec963919e78b14f7b0a95673312126655f454 100644 Binary files a/arkui/ace_ets_web_dev/signature/openharmony_sx.p7b and b/arkui/ace_ets_web_dev/signature/openharmony_sx.p7b differ